VectorExtensionMethods
Extension methods for Eto.Drawing.SizeF, Vector2d and Vector3d.
Methods
Compute the clockwise and anti-clockwise angles between two vectors.
Measure the angle from the plane x-axis to the projection of the xyz point.
Compute the average of a collection of points.
Parameters:
| points (IEnumerable<Point3d>) | Points to average. |
Returns: Average point.
Compute the average of a collection of points.
Parameters:
| points (Point3d[]) | Points to average. |
Returns: Average point.
Gets the parameter on a semi-finite ray which best approximates a 3D point.
Comparison of two planes.
Create a vector perpendicular to the input vector using custom primary and secondary axes. The length of the perpendicular vector will be identical to the length of the secondary axis, not the input vector.
Create a vector perpendicular to the input vector using default primary and secondary axes. The length of the perpendicular vector will be 1.0
Parameters:
| vector (Vector3d) |
Gets the smallest distance from a semi-finite ray to a 3D point.
Attempt to find a field scalar value along a finite line segment using binary-like searching.
Flip a vector if the flipped direction better aligns with a guide vector.
Flip a vector if the flipped direction better aligns with a guide vector.
Intersect a plane with a finite line segment.
Test whether a matrix has a specific size.
Test whether a matrix has a specific size.
Parameters:
| matrix (Matrix) | Matrix to test. |
| sizes (params (int rows, int columns)[]) | Potential sizes. |
Returns: True if matrix is this exact size.
Get the domain on a line segment which perpendicularly spans an entire box.
Parameters:
| line (Line) | |
| box (BoundingBox) |
Get the domain on a line segment which perpendicularly spans an entire box.
Get the domain on a line segment which perpendicularly spans an entire box.
Parameters:
| line (Line) | |
| points (IEnumerable<Point3d>) | Points to span. |
Get the domain on a line segment which perpendicularly spans an entire box.
Evaluate the plane at a given coordinate.
Evaluate the plane at a given coordinate.
Rewrite a point in world coordinates in two-dimensional uv coordinates.
Rewrite a point in world coordinates in two-dimensional uv coordinates.
Perform slerp interpolation on two vectors.
Convert a SizeF into a Point2d.
Parameters:
| size (SizeF) | Size. |
Returns: Vector.
Convert a Vector3d into a Vector2d.
Parameters:
| vector (Vector3d) | Vector. |
Returns: Vector.
Parameters:
| point (Point3f) |
Convert a SizeF into a Vector3d.
Parameters:
| size (SizeF) | Size. |
Returns: Vector.
Convert a Vector2d into a Vector3d.
Parameters:
| vector (Vector2d) | Vector. |
Returns: Vector.
Convert a Vector3d into a Vector2d.
Parameters:
| vector (Vector3d) | Vector. |
Returns: Vector.
Convert a column or row matrix with two cells into a complex number.
Parameters:
| matrix (Matrix) |
Returns: Complex number.
public static Matrix ToMathNetMatrix(this Matrix matrix)
Convert a RhinoCommon matrix into a MathNet matrix.
Parameters:
| matrix (Matrix) |
Convert a column or row matrix with three cells into a point.
Parameters:
| matrix (Matrix) |
Returns: Point.
public static Size ToSize(this SizeF point)
Convert a SizeF into a Size.
Parameters:
| point (SizeF) | Size to convert. |
Returns: Size.
Convert a 3×3, or 4×3, or 4×4 matrix into a transformation.
Parameters:
| matrix (Matrix) | Matrix to transform. |
Returns: Transformation.
Convert a column or row matrix with three cells into a vector.
Parameters:
| matrix (Matrix) |
Returns: Vector.
Transform a vector spatially. This is needed when transforming vectors using shear or taper matrices. This method differs from the standard Vector3d.Transform method in that it retains perpendicularity through taper and shear deformations. This method does not guarantee that the magnitude of the result is anywhere near correct, it is only concerned with the direction.