|
MathWorx | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Vector | +--point3D
The point3D class defines a point in 3-dimensional Euclidean space via homogeneous coordinates (i.e. as a 4-vector (x,y,z,1)). This allows affine transformations to be applied to 3-D points via matrix multiplication.
Defined in point3D.js
Requires:
Field Summary | |
Array |
components
The components of the 3D point. |
<final> Integer |
n
The "dimension" of the point; ALWAYS 3. |
Number |
x
The x-value of the 3D point. |
Number |
y
The y-value of the 3D point. |
Number |
z
The z-value of the 3D point. |
<static> Object |
zero
|
Fields inherited from class Vector |
components, n
|
Constructor Summary | |
point3D(<Number> x, <Number> y, <Number> z)
Constructor function. |
Method Summary | |
point3D
|
map(func)
Maps this point to a new 3D point according to a given function. |
Object
|
rotate(<Number> theta, <Object> axis)
Rotates a point3D object through an angle theta about an arbitrary axis. |
point3D
|
rotateX(<Number> phi)
Rotates a 3D point through an angle phi about the x axis and returns a new 3D point. |
point3D
|
rotateY(<Number> theta)
Rotates a 3D point through an angle theta about the y axis and returns a new 3D point. |
point3D
|
rotateZ(<Number> psi)
Rotates a 3D point through an angle psi about the y axis and returns a new 3D point. |
point3D
|
toSpherical()
Converts a point in Cartesian coordinates to spherical coordinates (r, psi, theta). |
String
|
toString()
Produces a string representation of the point. |
Vector
|
toVector()
Converts point3D object back to a Vector. |
point3D
|
translate(<Number> dx,<Number> dy,<Number> dz)
Returns a new 3D point (x',y',z',1) = (x+dx,y+dy,z+dz,1). |
Methods inherited from class Vector |
get, toEach, equalTo, normalize, linearlyIndependent, linearlyDependent, add, subtract, round, multiplyBy, dot, cross, resolute, reflectionIn, negative, toColumnMatrix, toRowMatrix, getLength, angleBetween, isParallel, isAntiParallel, isPerpendicular, distanceFrom, dimension, make3D, snapTo, indexOf, max, elements, addElement, toPoint
|
Field Detail |
Array components
<final> Integer n
Number x
Number y
Number z
<static> Object zero
Constructor Detail |
point3D(<Number> x, <Number> y, <Number> z)
x
- the x component
y
- the y component
z
- the z component
Method Detail |
point3D map(func)
func
- {Object} the mapping function
Object rotate(<Number> theta, <Object> axis)
theta
- the degree (in radians) to rotate the point
axis
- the axis about which to rotate; either a point3D, 3-D Vector or 3D Array
point3D rotateX(<Number> phi)
phi
- the angle in radians to rotate the point
point3D rotateY(<Number> theta)
theta
- the angle in radians to rotate the point
point3D rotateZ(<Number> psi)
psi
- the angle in radians to rotate the point
point3D toSpherical()
String toString()
Vector toVector()
point3D translate(<Number> dx,<Number> dy,<Number> dz)
dx
- the x translation
dy
- the y translation
dz
- the z translation
|
MathWorx | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |