Generated by DocFX

Struct Point4

Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
public struct Point4 : IEquatable<Point4>

Constructors

| Improve this Doc View Source

Point4(Point3)

Initializes a new instance of the Point4 class from the coordinates of a point.

Declaration
public Point4(Point3 point)
Parameters
Type Name Description
Point3 point

Coordinates of the control point.

| Improve this Doc View Source

Point4(Point3, Double)

Initializes a new instance of the Point4 class from the coordinates of a point and a weight.

Declaration
public Point4(Point3 point, double weight)
Parameters
Type Name Description
Point3 point

Coordinates of the control point.

System.Double weight

Weight factor of the control point. You should not use weights less than or equal to zero.

| Improve this Doc View Source

Point4(Double, Double, Double, Double)

Initializes a new instance of the Point4 class based on coordinates.

Declaration
public Point4(double x, double y, double z, double w)
Parameters
Type Name Description
System.Double x

The X (first) dimension.

System.Double y

The Y (second) dimension.

System.Double z

The Z (third) dimension.

System.Double w

The W (fourth) dimension, or weight.

Properties

| Improve this Doc View Source

IsValid

Each coordinate of the a control point must pass the IsValidDouble(Double) test.

Declaration
public readonly bool IsValid { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Item[Int32]

Declaration
public double this[int i] { get; set; }
Parameters
Type Name Description
System.Int32 i
Property Value
Type Description
System.Double
| Improve this Doc View Source

Size

Dimension of point.

Declaration
public readonly int Size { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Unset

Gets the value of a control point with all coordinates set as RhinoMath.UnsetValue.

Declaration
public static readonly Point4 Unset { get; }
Property Value
Type Description
Point4
| Improve this Doc View Source

W

Gets or sets the W (fourth) coordinate -or weight- of this control point.

Declaration
public double W { readonly get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

X

Gets or sets the X (first) coordinate of this control point.

Declaration
public double X { readonly get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Y

Gets or sets the Y (second) coordinate of this control point.

Declaration
public double Y { readonly get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Z

Gets or sets the Z (third) coordinate of this control point.

Declaration
public double Z { readonly get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Zero

Gets the value of a control point with all coordinates set as zero.

Declaration
public static readonly Point4 Zero { get; }
Property Value
Type Description
Point4

Methods

| Improve this Doc View Source

DistanceTo(Point4)

Computes the distance between two control points.

Declaration
public double DistanceTo(Point4 other)
Parameters
Type Name Description
Point4 other

Other control points for distance measurement.

Returns
Type Description
System.Double

The length of the line between this and the other control points; or 0 if any of the control points is not valid.

| Improve this Doc View Source

EpsilonEquals(Point4, Double)

Check that all values in other are within epsilon of the values in this

Declaration
public bool EpsilonEquals(Point4 other, double epsilon)
Parameters
Type Name Description
Point4 other
System.Double epsilon
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Point4)

Determines whether the specified point has same value as the present point.

Declaration
public bool Equals(Point4 point)
Parameters
Type Name Description
Point4 point

The specified point.

Returns
Type Description
System.Boolean

true if point has the same value as this; otherwise false.

| Improve this Doc View Source

Equals(Object)

Determines whether the specified System.Object is Point4d and has same coordinates as the present point.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The specified object.

Returns
Type Description
System.Boolean

true if obj is Point4d and has the same coordinates as this; otherwise false.

Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Computes the hash code for the present point.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A non-unique hash code, which uses all coordiantes of this object.

Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

GetWeights(IEnumerable<Point4>)

Obtains the weight from a collection of control points in homogeneous space, assuming all are the same dimension.

Declaration
public static List<double> GetWeights(IEnumerable<Point4> homogenizedPoints)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Point4> homogenizedPoints

Control points represented by an array (wi*pi, wi) with length (dim+1).

Returns
Type Description
System.Collections.Generic.List<System.Double>

A set of values, represented by a set pi with length (dim).

| Improve this Doc View Source

GetWeights2d(IEnumerable<IEnumerable<Point4>>)

Obtains the weight from a two-dimensional collection of control points in homogeneous space, assuming all are the same dimension.

Declaration
public static List<List<double>> GetWeights2d(IEnumerable<IEnumerable<Point4>> homogenizedPoints)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<Point4>> homogenizedPoints

Two-dimensional set of control points represented by an array (wi*pi, wi) with length (dim+1)

Returns
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<System.Double>>

Two-dimensional set of values, each represented by an array pi with length (dim)

| Improve this Doc View Source

Interpolate(Point4, Point4, Double)

Interpolate between two control points returning a new control points at the given interpolation parameter.

Declaration
public static Point4 Interpolate(Point4 pA, Point4 pB, double t)
Parameters
Type Name Description
Point4 pA

First point.

Point4 pB

Second point.

System.Double t

Interpolation parameter. If t=0 then this point is set to pA. If t=1 then this point is set to pB. Values of t in between 0.0 and 1.0 result in control point between pA and pB.

Returns
Type Description
Point4
| Improve this Doc View Source

PointDehomogenizer(Point4)

Gets a dehomogenized point from a homogenized curve point.

Declaration
public static Point3 PointDehomogenizer(Point4 homogenizedCurvePoint)
Parameters
Type Name Description
Point4 homogenizedCurvePoint

A control point represented by an array (wi*pi, wi) with length (dim+1).

Returns
Type Description
Point3

A dehomogenized point.

| Improve this Doc View Source

PointDehomogenizer1d(IEnumerable<Point4>)

Gets a set of dehomogenized points.

Declaration
public static List<Point3> PointDehomogenizer1d(IEnumerable<Point4> homogenizedPoints)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Point4> homogenizedPoints

A collection of points represented by an array (wi*pi, wi) with length (dim+1).

Returns
Type Description
System.Collections.Generic.List<Point3>

Set of dehomogenized points.

| Improve this Doc View Source

PointDehomogenizer2d(IEnumerable<IEnumerable<Point4>>)

Gets a two-dimensional set of dehomogenized points.

Declaration
public static List<List<Point3>> PointDehomogenizer2d(IEnumerable<IEnumerable<Point4>> homogenizedPoints)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<Point4>> homogenizedPoints

Two-dimensional set of points represented by an array (wi*pi, wi) with length (dim+1)

Returns
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<Point3>>

Two-dimensional set of dehomogenized points.

| Improve this Doc View Source

PointsHomogeniser(List<Point3>, List<Double>)

Transforms a collection of control points into their homogeneous equivalents.
http://deltaorange.com/2012/03/08/the-truth-behind-homogenous-coordinates/

Declaration
public static List<Point4> PointsHomogeniser(List<Point3> controlPoints, List<double> weights)
Parameters
Type Name Description
System.Collections.Generic.List<Point3> controlPoints

Control points, a set of size (points count x points dimension).

System.Collections.Generic.List<System.Double> weights

Control point weights, the same size as the set of control points (points count x 1).

Returns
Type Description
System.Collections.Generic.List<Point4>

A set of control points where each point is (wi*pi, wi)
where wi the ith control point weight and pi is the ith control point, hence the dimension of the point is dim + 1.

| Improve this Doc View Source

PointsHomogeniser(List<Point3>, Double)

Transforms a collection of control points into their homogeneous equivalents, by a given weight value.
http://deltaorange.com/2012/03/08/the-truth-behind-homogenous-coordinates/

Declaration
public static List<Point4> PointsHomogeniser(List<Point3> controlPoints, double weight)
Parameters
Type Name Description
System.Collections.Generic.List<Point3> controlPoints

Control points, a set of size (points count x points dimension).

System.Double weight

Weight value for each point.

Returns
Type Description
System.Collections.Generic.List<Point4>

A set of control points where each point is (wi*pi, wi)
where wi the ith control point weight and pi is the ith control point, hence the dimension of the point is dim + 1.

| Improve this Doc View Source

PointsHomogeniser2d(List<List<Point3>>, List<List<Double>>)

Transforms a two-dimension collection of control points into their homogeneous equivalents.
http://deltaorange.com/2012/03/08/the-truth-behind-homogenous-coordinates/

Declaration
public static List<List<Point4>> PointsHomogeniser2d(List<List<Point3>> controlPoints, List<List<double>> weights = null)
Parameters
Type Name Description
System.Collections.Generic.List<System.Collections.Generic.List<Point3>> controlPoints

Control points, a two-dimensional set of size (points count x points dimension).

System.Collections.Generic.List<System.Collections.Generic.List<System.Double>> weights

Control point weights, the same size as the set of control points (points count x 1).

Returns
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<Point4>>

A two-dimensional set of control points where each point is (wi*pi, wi)
where wi the ith control point weight and pi is the ith control point, hence the dimension of the point is dim + 1.

| Improve this Doc View Source

Rational2d(IEnumerable<IEnumerable<Point4>>)

Obtains the point from a two-dimensional set of homogeneous points without dehomogenization, assuming all are the same length.

Declaration
public static List<List<Point3>> Rational2d(IEnumerable<IEnumerable<Point4>> homogenizedPoints)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<Point4>> homogenizedPoints

Two-dimensional set of points represented by an array (wi*pi, wi) with length (dim+1)

Returns
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<Point3>>

Two-dimensional set of rational points.

| Improve this Doc View Source

RationalPoints(IEnumerable<Point4>)

Obtains the point from homogeneous point without dehomogenization, assuming all are the same length.

Declaration
public static List<Point3> RationalPoints(IEnumerable<Point4> homogenizedPoints)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Point4> homogenizedPoints

Sets of points represented by an array (wi*pi, wi) with length (dim+1).

Returns
Type Description
System.Collections.Generic.List<Point3>

Set of rational points.

| Improve this Doc View Source

ToString()

Constructs the string representation for the current point.

Declaration
public override string ToString()
Returns
Type Description
System.String

The point representation in the form X,Y,Z,W.

Overrides
System.ValueType.ToString()
| Improve this Doc View Source

Transform(TransformMatrix)

Transforms the control point using a transformation matrix.

Declaration
public Point4 Transform(TransformMatrix t)
Parameters
Type Name Description
TransformMatrix t

The transformation matrix.

Returns
Type Description
Point4

The transformed control point as a new instance.

| Improve this Doc View Source

WeightedAddiction(Point4, Point4)

Calculates the weighted addition of two Point4 together.

Declaration
public static Point4 WeightedAddiction(Point4 ctrlPoint1, Point4 ctrlPoint2)
Parameters
Type Name Description
Point4 ctrlPoint1

First control point.

Point4 ctrlPoint2

Second control point.

Returns
Type Description
Point4

A new control point that results from the weighted addition of ctrlPoint1 and ctrlPoint2.

| Improve this Doc View Source

WeightedSubtraction(Point4, Point4)

Subtracts the second point from the first point.

Declaration
public static Point4 WeightedSubtraction(Point4 ctrlPoint1, Point4 ctrlPoint2)
Parameters
Type Name Description
Point4 ctrlPoint1

First point.

Point4 ctrlPoint2

Second point.

Returns
Type Description
Point4

A new point that results from the weighted subtraction of ctrlPoint2 from ctrlPoint1.

Operators

| Improve this Doc View Source

Addition(Point4, Point4)

Sums two Point4 together.

Declaration
public static Point4 operator +(Point4 ctrlPoint1, Point4 ctrlPoint2)
Parameters
Type Name Description
Point4 ctrlPoint1

First control point.

Point4 ctrlPoint2

Second control point.

Returns
Type Description
Point4

A new control point that result of the addition of ctrlPoint1 and ctrlPoint2.

| Improve this Doc View Source

Division(Point4, Double)

Divides a control point by a number.

Declaration
public static Point4 operator /(Point4 point, double d)
Parameters
Type Name Description
Point4 point

A control point.

System.Double d

A number.

Returns
Type Description
Point4

A new control point that results from the coordinatewise division of control point with d.

| Improve this Doc View Source

Equality(Point4, Point4)

Determines whether two control point have equal values.

Declaration
public static bool operator ==(Point4 a, Point4 b)
Parameters
Type Name Description
Point4 a

The first control point.

Point4 b

The second control point.

Returns
Type Description
System.Boolean

true if the coordinates of the two control points are equal; otherwise false.

| Improve this Doc View Source

Implicit(Point4 to Vector)

Converts a control point in a vector, without needing casting.

Declaration
public static implicit operator Vector(Point4 point4)
Parameters
Type Name Description
Point4 point4

A control point.

Returns
Type Description
Vector

The resulting Vector.

| Improve this Doc View Source

Inequality(Point4, Point4)

Determines whether two control point have different values.

Declaration
public static bool operator !=(Point4 a, Point4 b)
Parameters
Type Name Description
Point4 a

The first control point.

Point4 b

The second control point.

Returns
Type Description
System.Boolean

true if the two control points differ in any coordinate; false otherwise.

| Improve this Doc View Source

Multiply(Point4, Point4)

Multiplies two Point4 together, returning the dot (internal) product of the two. This is not the cross product.

Declaration
public static double operator *(Point4 ctrlPoint1, Point4 ctrlPoint2)
Parameters
Type Name Description
Point4 ctrlPoint1

The first control point.

Point4 ctrlPoint2

The second control point.

Returns
Type Description
System.Double

A value that results from the coordinatewise multiplication of ctrlPoint1 and ctrlPoint2.

| Improve this Doc View Source

Multiply(Point4, Double)

Multiplies a control point by a number.

Declaration
public static Point4 operator *(Point4 point, double d)
Parameters
Type Name Description
Point4 point

A control point.

System.Double d

A number.

Returns
Type Description
Point4

A new control point that results from the coordinatewise multiplication of control point with d.

| Improve this Doc View Source

Subtraction(Point4, Point4)

Sums two Point4 together.

Declaration
public static Point4 operator -(Point4 ctrlPoint1, Point4 ctrlPoint2)
Parameters
Type Name Description
Point4 ctrlPoint1

First point.

Point4 ctrlPoint2

Second point.

Returns
Type Description
Point4

A new point that result of the subtraction of ctrlPoint1 and ctrlPoint2.

Implements

System.IEquatable<T>