| Package | alternativa.types |
| Class | public final class Point3D |
| Property | Defined by | ||
|---|---|---|---|
| length : Number Vector length.
| Point3D | ||
| lengthSqr : Number [read-only] The square of vector length.
| Point3D | ||
| x : Number X coordinate
| Point3D | ||
| y : Number Y coordinate
| Point3D | ||
| z : Number Z coordinate
| Point3D | ||
| Method | Defined by | ||
|---|---|---|---|
|
Point3D(x:Number = 0, y:Number = 0, z:Number = 0)
Create an instance of class.
| Point3D | ||
|
Coordinates summ.
| Point3D | ||
|
[static]Calculate angle between vectors.
| Point3D | ||
|
[static]Calculate angle between unit vectors.
| Point3D | ||
|
[static]Calculate an average point.
| Point3D | ||
|
Clone point.
| Point3D | ||
|
Copy point coordinates.
| Point3D | ||
|
[static]Calculate vector product.
| Point3D | ||
|
Calculates cross product of two given vectors and stores the result in the current vector.
| Point3D | ||
|
[static]Get vector XY plane vectors projections product.
| Point3D | ||
|
[static]Calculate vector difference.
| Point3D | ||
|
[static]Calculate scalar vector product.
| Point3D | ||
|
[static]Get scalar XY plane vectors projections product.
| Point3D | ||
|
Compare points coordinates to a given treshold.
| Point3D | ||
|
floor():void
Apply
Math. | Point3D | ||
|
[static]Linear coordinates interpolation.
| Point3D | ||
|
invert():void
Invert vector.
| Point3D | ||
|
multiply(n:Number):void
Multiply by scalar.
| Point3D | ||
|
normalize():void
Normalize vector to a unit length.
| Point3D | ||
|
random(xMin:Number = 0, xMax:Number = 0, yMin:Number = 0, yMax:Number = 0, zMin:Number = 0, zMax:Number = 0):Point3D
[static]Create point with random coordinates.
| Point3D | ||
|
reset(x:Number = 0, y:Number = 0, z:Number = 0):void
Set zero coordinates.
| Point3D | ||
|
round():void
Round point coordinates.
| Point3D | ||
|
Subtract coordinates.
| Point3D | ||
|
[static]Calculate sum of vectors.
| Point3D | ||
|
toPoint():Point
Get plane XY projection of the point
| Point3D | ||
|
toString():String
String vector representation.
| Point3D | ||
|
Point (vector) transformation.
| Point3D | ||
|
transformOrientation(m:Matrix3D):void
| Point3D | ||
| length | property |
length:Number [read-write]Vector length.
Implementation public function get length():Number
public function set length(value:Number):void
| lengthSqr | property |
lengthSqr:Number [read-only]The square of vector length.
Implementation public function get lengthSqr():Number
| x | property |
public var x:NumberX coordinate
| y | property |
public var y:NumberY coordinate
| z | property |
public var z:NumberZ coordinate
| Point3D | () | constructor |
public function Point3D(x:Number = 0, y:Number = 0, z:Number = 0)Create an instance of class.
Parametersx:Number (default = 0) — X coordinate |
|
y:Number (default = 0) — Y coordinate |
|
z:Number (default = 0) — Z coordinate |
| add | () | method |
public function add(point:Point3D):voidCoordinates summ.
Parameterspoint:Point3D — the point which coordinates are being added to own |
| angle | () | method |
public static function angle(p1:Point3D, p2:Point3D):NumberCalculate angle between vectors.
Parametersp1:Point3D — first vector |
|
p2:Point3D — second vector |
Number — angle between the vectors in radians |
| angleFast | () | method |
public static function angleFast(p1:Point3D, p2:Point3D):NumberCalculate angle between unit vectors.
Parametersp1:Point3D — first vector |
|
p2:Point3D — second vector |
Number — angle between the vectors in radians |
| average | () | method |
public static function average(a:Point3D, b:Point3D = null, c:Point3D = null, d:Point3D = null):Point3DCalculate an average point.
Parametersa:Point3D — first point |
|
b:Point3D (default = null) — second point |
|
c:Point3D (default = null) — third point |
|
d:Point3D (default = null) — fourth point |
Point3D — averge point |
| clone | () | method |
| copy | () | method |
public function copy(point:Point3D):voidCopy point coordinates.
Parameterspoint:Point3D — point which coordinates are being copied |
| cross | () | method |
public static function cross(a:Point3D, b:Point3D):Point3DCalculate vector product.
Parametersa:Point3D — first multiplier |
|
b:Point3D — second multiplier |
Point3D — cross-product of the vectors |
| cross2 | () | method |
public function cross2(a:Point3D, b:Point3D):voidCalculates cross product of two given vectors and stores the result in the current vector.
Parametersa:Point3D — first vector |
|
b:Point3D — second vector |
| cross2D | () | method |
public static function cross2D(a:Point3D, b:Point3D):NumberGet vector XY plane vectors projections product.
Parametersa:Point3D — first multiplier |
|
b:Point3D — second multiplier |
Number — cross-product of projections of the vectors on XY plane |
| difference | () | method |
public static function difference(a:Point3D, b:Point3D):Point3DCalculate vector difference.
Parametersa:Point3D — minuend vector |
|
b:Point3D — subtrahend vector |
Point3D — vector ab = a - b |
| dot | () | method |
public static function dot(a:Point3D, b:Point3D):NumberCalculate scalar vector product.
Parametersa:Point3D — first multiplier |
|
b:Point3D — second multiplier |
Number — dot-product of the vectors |
| dot2D | () | method |
public static function dot2D(a:Point3D, b:Point3D):NumberGet scalar XY plane vectors projections product.
Parametersa:Point3D — first multiplier |
|
b:Point3D — second multiplier |
Number — dot-product of projections of the vectors on XY plane |
| equals | () | method |
public function equals(point:Point3D, threshold:Number = 0):BooleanCompare points coordinates to a given treshold.
Parameterspoint:Point3D — Point to compare. |
|
threshold:Number (default = 0) — comparison threshold |
Boolean — true if absolute difference between any corresponding coordinates of the points is not greater than given threshold, otherwise false |
| floor | () | method |
public function floor():voidApply Math.floor() function to point coordinates.
| interpolate | () | method |
public static function interpolate(p1:Point3D, p2:Point3D, k:Number = 0.5):Point3DLinear coordinates interpolation. Interpolation uses p1 + (p2 - p1)k formula, where points p1 and p2 are limiting the segment, and k is an interpolation parameter.
p1:Point3D — beginning segment point |
|
p2:Point3D — finishing segment point |
|
k:Number (default = 0.5) — parameter value |
Point3D — interpolated coordinates |
| invert | () | method |
public function invert():voidInvert vector.
| multiply | () | method |
public function multiply(n:Number):voidMultiply by scalar.
Parametersn:Number — a number by which coordinates are being multiplied |
| normalize | () | method |
public function normalize():voidNormalize vector to a unit length.
| random | () | method |
public static function random(xMin:Number = 0, xMax:Number = 0, yMin:Number = 0, yMax:Number = 0, zMin:Number = 0, zMax:Number = 0):Point3DCreate point with random coordinates.
ParametersxMin:Number (default = 0) — minimum X coordinate value |
|
xMax:Number (default = 0) — maximum X coordinate value |
|
yMin:Number (default = 0) — minimum Y coordinate value |
|
yMax:Number (default = 0) — maximum Y coordinate value |
|
zMin:Number (default = 0) — minimum Z coordinate value |
|
zMax:Number (default = 0) — maximum Z coordinate value |
Point3D — a point with random coordinates |
| reset | () | method |
public function reset(x:Number = 0, y:Number = 0, z:Number = 0):voidSet zero coordinates.
Parametersx:Number (default = 0) |
|
y:Number (default = 0) |
|
z:Number (default = 0) |
| round | () | method |
public function round():voidRound point coordinates.
| subtract | () | method |
public function subtract(point:Point3D):voidSubtract coordinates.
Parameterspoint:Point3D — point which coordinates are being subtracted from own |
| sum | () | method |
public static function sum(a:Point3D, b:Point3D):Point3DCalculate sum of vectors.
Parametersa:Point3D — first item |
|
b:Point3D — second item |
Point3D — sum of the vectors |
| toPoint | () | method |
public function toPoint():PointGet plane XY projection of the point
ReturnsPoint — projection on XY plane |
| toString | () | method |
public function toString():StringString vector representation.
ReturnsString — string vector representation |
| transform | () | method |
public function transform(m:Matrix3D):voidPoint (vector) transformation. New coordinates value is a result of matrix multiply on vector M × r.
m:Matrix3D — transformation matrix |
| transformOrientation | () | method |