Defines a point in 3D Cartesian space.
Part of MathLib, a diverse library of mathematical functions.
Defines a new Cartesian point.
Get or set the x coordinate value.
Get or set the y coordinate value.
Get or set the z coordinate value.
Sets the Cartesian point x, y and z values.
Answers a Boolean whether the receiver equals the argument.
Returns a hash value for the receiver.
Multiplication.
scale |
Cartesian.new(this.x * scale.x, this.y * scale.y, this.z * scale.z)
Note that the result of * for a 3D Cartesian point does not match that of Point, where the result is interpreted as the multiplication of complex numbers.
Division.
scale |
Cartesian.new(this.x / scale.x, this.y / scale.y, this.z / scale.z)
Note that the result of / for a 3D Cartesian point does not match that of Point, where the result is interpreted as the division of complex numbers.
Addition by a Cartesian point.
Multiplication by a Cartesian point.
Division by a Cartesian point.
Rotation about the origin in the XY plane by the angle given in radians.
Positive values rotate from +X towards +Y
Rotation about the origin in the YZ plane by the angle given in radians.
Positive values rotate from +Y towards +Z
Rotation about the origin in the XZ plane by the angle given in radians.
Positive values rotate from +X towards +Z
Rotation about the origin in the XY plane by the angle given in radians.
A synonym for rotate.
Rotation about the origin in the YZ plane by the angle given in radians.
A synonym for tilt.
Rotation about the origin in the XZ plane by the angle given in radians.
A synonym for tumble.
Mirror x, reflecting across the YZ plane.
Mirror y, reflecting across the XZ plane.
Mirror z, reflecting across the XY plane.
Mirror across the origin.
Absolute value of the point.
Return the spherical coordinate radius of the receiver.
Return the spherical coordinate azimuth angle of the receiver.
Return the spherical coordinate elevation angle of the receiver.
Return the spherical coordinate azimuth angle of the receiver.
Return the spherical coordinate azimuth and elevation angles of the receiver.
[ theta, phi]
Return the distance from the receiver to aCart.
Return a Cartesian point whose x and y coordinates are swapped.
Matches the return value for Point: -transpose.
Return a Cartesian point whose x and y coordinates are swapped.
A synonym for transpose.
Return a Cartesian point whose y and z coordinates are swapped.
Return a Cartesian point whose x and z coordinates are swapped.
Round the coordinate values to a multiple of quantum.
Truncate the coordinate values to a multiple of quantum.
Returns the receiver.
Returns a Point, discarding z.
Returns a Complex with x as the real part and y as the imaginary part, discarding z.
Returns a Polar, discarding z.
Returns a Spherical.
Joseph Anderson, 2011.