Name | Type | Description |
---|---|---|
kOrigin | MFloatPoint | (0, 0, 0, 1) |
kTolerance | Float | Default tolerance used for inexact comparisons. |
None.
None.
Signature | Parameters | Description |
---|---|---|
MFloatPoint() | Default constructor. Returns a new MFloatPoint object, initialized to the origin. | |
MFloatPoint(src) | src - MFloatPoint, MPoint, MFloatVector or MVector | Copy constructor. Returns a new MFloatPoint object with its x, y, z and w coords set to the same values as src. If src is a vector then the new MFloatPoint's w coordinate is set to 1.0. |
MFloatPoint(seq) | seq - sequence of two, three or four Floats | Returns a new MFloatPoint object whose x, y, z and w coordinates are set to the elements of seq. If the sequence contains fewer than four values w will be set to 1.0. If the sequence contains fewer than three values z will be set to 0.0. |
MFloatPoint(x, y, z=0.0, w=1.0) | x - Float
y - Float z - Float w - Float |
Returns a new MFloatPoint object with the specified x, y, z and w coordinates. |
Signature | Parameters | Returns | Description |
---|---|---|---|
cartesianize() | Reference to self. | Converts this point to cartesian form. | |
rationalize() | Reference to self. | Converts this point to rational form. | |
homogenize() | Reference to self. | Converts this point to homogenous form. | |
distanceTo(other) | other - MFloatPoint | Float | Returns the distance between this point and other. |
isEquivalent(other, tol=kTolerance) | other - MFloatPoint
tol - Float |
Bool | Returns True if the coordinates of this point and other are equal to within a tolerance of tol. |
Name | Type | Access | Description |
---|---|---|---|
x | Float | RW | X coordinate |
y | Float | RW | Y coordinate |
z | Float | RW | Z coordinate |
w | Float | RW | W coordinate |
An MFloatPoint is treated a sequence of four Float values: [x, y, z, w].
len() returns 4.
Indexing and element assignment are supported.
Deletion, concatenation, repetition and slicing are not supported.
Operation | Description |
---|---|
MFloatPoint = MFloatPoint + MFloatVector | Addition of a vector to a point. |
MFloatPoint += MFloatVector | In-place addition of a vector to the point. Returns a new reference to the point. |
MFloatPoint = MFloatPoint - MFloatVector | Subtraction of a vector from a point. |
MFloatPoint -= MFloatVector | In-place subtraction of a vector from a point. Returns a new reference to the point. |
MFloatVector = MFloatPoint - MFloatPoint | Vector difference between two points. |
MFloatPoint = MFloatMatrix* MFloatPoint | Pre-multiplication of a point by a matrix. |
MFloatPoint = MFloatPoint * MFloatMatrix | Post-multiplication of a point by a matrix. |
MFloatPoint *= MFloatMatrix | In-place post-multiplication of a point by a matrix. Returns a new reference to the point. |
MFloatPoint = MFloatPoint * scalar | Multiplication of a point by a scalar. The scalar must be convertable to Float. |
MFloatPoint = MFloatPoint / scalar | Division of a point by a scalar. The scalar must be convertable to Float. |
MFloatPoint == MFloatPoint | Returns True if each component of the first point is exactly equal to the corresponding component of the second. |
MFloatPoint != MFloatPoint | Returns False is any component of the first point is not exactly equal to the corresponding component of the second. |
All other comparison operators will raise a TypeError exception.
© 2011 Autodesk, Inc. All rights reserved.