Point3f

References
[StructLayout(LayoutKind.Sequential, Pack = 4, Size = 12)] [DebuggerDisplay("({m_x}, {m_y}, {m_z})")] [Serializable] public struct Point3f : IEquatable<Point3f>, IComparable<Point3f>, IComparable, IEpsilonFComparable<Point3f>, IFormattable
Represents the three coordinates of a point in three-dimensional space, using float-precision floating point numbers.

Constructors

Point3f

#Since v5.0
Initializes a new two-dimensional vector from two components.
public Point3f(
x,
X component of vector.
y,
Y component of vector.
z
Z component of vector.
)

Properties

IsValid

#Since v5.0
Each coordinate of the point must pass the RhinoMath.IsValidSingle(float) test.
public bool IsValid { get; }

Origin

#Since v5.0
Gets the value of a point at location 0,0,0.
public static Point3f Origin { get; }

Unset

#Since v5.0
Gets the value of a point at location RhinoMath.UnsetValue,RhinoMath.UnsetValue,RhinoMath.UnsetValue.
public static Point3f Unset { get; }

X

#Since v5.0
Gets or sets the X (first) component of the vector.
public float X { get; set; }

Y

#Since v5.0
Gets or sets the Y (second) component of the vector.
public float Y { get; set; }

Z

#Since v5.0
Gets or sets the Z (third) component of the vector.
public float Z { get; set; }

Methods

Add

#
Sums up a point and a vector, and returns a new point.

(Provided for languages that do not support operator overloading. You can use the + operator otherwise)

public static Point3f Add(
point,
A point.
vector
A vector.
)
A new point that results from the addition of point and vector.

Add

#
Adds a point to another point.

(Provided for languages that do not support operator overloading. You can use the + operator otherwise)

public static Point3f Add(
point1,
A point.
point2
Another point.
)
A new point that is the sum of point1 plus point2.

Add

#
Sums up a point and a vector, and returns a new point.

(Provided for languages that do not support operator overloading. You can use the + operator otherwise)

public static Point3f Add(
vector,
A vector.
point
A point.
)
A new point that results from the addition of point and vector.

CompareTo

#Since v5.0
Compares this Point3f with another Point3f.

Component evaluation priority is first X, then Y, then Z.

[ConstOperation] public int CompareTo(
other
The other Point3d to use in comparison.
)

0: if this is identical to other

-1: if this.X < other.X

-1: if this.X == other.X and this.Y < other.Y

-1: if this.X == other.X and this.Y == other.Y and this.Z < other.Z

+1: otherwise.

DistanceTo

#ExampleSince v5.0
Computes the distance between two points.
[ConstOperation] public double DistanceTo(
other
Other point for distance measurement.
)
The length of the line between this and the other point; or 0 if any of the points is not valid.

DistanceToSquared

#Since v7.14
Computes the squared distance between two points.
[ConstOperation] public double DistanceToSquared(
other
Other point for distance measurement.
)
The squared length of the line between this and the other point; or 0 if any of the points is not valid.

Divide

#
Divides a point by a factor.

(Provided for languages that do not support operator overloading. You can use the / operator otherwise)

public static Point3f Divide(
point,
A point.
value
A value.
)
A new point that is coordinate-wise divided by value.

EpsilonEquals

#Since v5.4
Check that all values in other are within epsilon of the values in this
[ConstOperation] public bool EpsilonEquals(
other,
epsilon
)
EpsilonEquals

Equals

#
Determines whether the specified System.Object is a Point3f and has the same values as the present point.
[ConstOperation] public override bool Equals(
obj
The specified object.
)
true if obj is Point3f and has the same coordinates as this; otherwise false.
ValueType.Equals

Equals

#Since v5.0
Determines whether the specified Point3f has the same values as the present point.
[ConstOperation] public bool Equals(
point
The specified point.
)
true if point has the same coordinates as this; otherwise false.

GetHashCode

#
Computes a hash code for the present point.
[ConstOperation] public override int GetHashCode()
A non-unique integer that represents this point.

Multiply

#
Multiplies a point by a factor.

(Provided for languages that do not support operator overloading. You can use the * operator otherwise)

public static Point3f Multiply(
value,
A value.
point
A point.
)
A new point that is coordinate-wise multiplied by value.

Multiply

#
Multiplies a point by a factor.

(Provided for languages that do not support operator overloading. You can use the * operator otherwise)

public static Point3f Multiply(
point,
A point.
value
A value.
)
A new point that is coordinate-wise multiplied by value.

Negate

#
Computes the additive inverse of all coordinates in the point, and returns the new point.

(Provided for languages that do not support operator overloading. You can use the - unary operator otherwise)

public static Point3f Negate(
point
A point.
)
A point value that, when summed with the point input, yields the Origin.

Subtract

#
Subtracts a vector from a point.

(Provided for languages that do not support operator overloading. You can use the - operator otherwise)

public static Point3f Subtract(
point,
A point.
vector
A vector.
)
A new point that is the difference of point minus vector.

Subtract

#Since v5.0
Subtracts a point from another point.

(Provided for languages that do not support operator overloading. You can use the - operator otherwise)

public static Vector3f Subtract(
point1,
A point.
point2
Another point.
)
A new vector that is the difference of point minus vector.
Explicit

IComparable.CompareTo

#
[ConstOperation] int IComparable.CompareTo(
obj
)

ToString

#
Constructs the string representation for the current point.
[ConstOperation] public override string ToString()
The point representation in the form X,Y,Z.

ToString

#Since v7.0
Formats the value of the current instance using the specified format.
[ConstOperation] public string ToString(
format,
The format to use. -or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.
formatProvider
The provider to use to format the value. -or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
)
The value of the current instance in the specified format.

Transform

#Since v5.0
Transforms the present point in place. The transformation matrix acts on the left of the point. i.e.,

result = transformation*point

public void Transform(
Transform
xform
Transformation to apply.
)

Operators

OperationResultDescription
Point3f+Point3fPoint3fAdds a point to another point.
Vector3f+Point3fPoint3fSums up a point and a vector, and returns a new point.
Point3f/floatPoint3fDivides a point by a factor.
Point3f==Point3fboolDetermines whether two points have equal values.
Point3f>Point3fboolDetermines whether the first specified point comes after (has superior sorting value than) the second point.

Coordinates evaluation priority is first X, then Y, then Z.

Point3f>=Point3fboolDetermines whether the first specified point comes after (has superior sorting value than) the second point, or it is equal to it.

Coordinates evaluation priority is first X, then Y, then Z.

Point3f!=Point3fboolDetermines whether two points have different values.
Point3f<Point3fboolDetermines whether the first specified point comes before (has inferior sorting value than) the second point.

Coordinates evaluation priority is first X, then Y, then Z.

Point3f<=Point3fboolDetermines whether the first specified point comes before (has inferior sorting value than) the second point, or it is equal to it.

Coordinates evaluation priority is first X, then Y, then Z.

float*Point3fPoint3fMultiplies a point by a factor.
Point3f*floatPoint3fMultiplies a point by a factor.
Point3f-Vector3fPoint3fSubtracts a vector from a point.
Point3f-Point3fVector3fSubtracts a point from another point.
-Point3fPoint3fComputes the additive inverse of all coordinates in the point, and returns the new point.

Convertors

OperationResultDescription
explicitPoint3dPoint3fConverts a double-precision point in a single-precision point. Needs explicit casting to help retain precision.
explicitPoint3fVector3fConverts a single-precision point in a single-precision vector. Needs explicit casting to help retain precision.