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
public Point3f(float x, float y, float z)
Initializes a new two-dimensional vector from two components.
x (float)X component of vector.
y (float)Y component of vector.
z (float)Z component of vector.

Properties

IsValid

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

Origin

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

Unset

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

X

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

Y

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

Z

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

Methods

CompareTo

#Since v5.0
[ConstOperation] public int CompareTo(Point3f other)
Compares this Point3f with another Point3f.

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

other (Point3f)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
[ConstOperation] public double DistanceTo(Point3f other)
Computes the distance between two points.
other (Point3f)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
[ConstOperation] public double DistanceToSquared(Point3f other)
Computes the squared distance between two points.
other (Point3f)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.

EpsilonEquals

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

Equals

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

Equals

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

GetHashCode

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

Subtract

#Since v5.0
public static Vector3f Subtract(Point3f point1, Point3f point2)
Subtracts a point from another point.

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

point1 (Point3f)A point.
point2 (Point3f)Another point.
A new vector that is the difference of point minus vector.
Explicit

IComparable.CompareTo

#
[ConstOperation] int IComparable.CompareTo(object obj)
obj (object)

ToString

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

ToString

#Since v7.0
[ConstOperation] public string ToString(string format, IFormatProvider formatProvider)
Formats the value of the current instance using the specified format.
format (string)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 (IFormatProvider)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
public void Transform(Transform xform)
Transforms the present point in place. The transformation matrix acts on the left of the point. i.e.,

result = transformation*point

xform (Transform)Transformation to apply.

Operators

OperationResultDescription
Point3f+Point3fPoint3fAdds a point to another point.
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-Point3fVector3fSubtracts a point from another 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.