Struct Plane
Plane, represented by the plane equation n·p+d=0,
where n is the normal [x,y,z] and p is any point on the plane.
Namespace: ABB.Robotics.Math
Assembly: ABB.Robotics.Math.dll
Syntax
public struct Plane
Constructors
View SourcePlane(Matrix4, Axis)
Creates a plane from a matrix
Declaration
public Plane(Matrix4 mat, Axis normal)
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | mat | the matrix to create the plane from |
| Axis | normal | Which axis will be the normal of the plane |
Plane(Vector3, Vector3)
Creates a plane from a normal and a point on the plane.
Declaration
public Plane(Vector3 normal, Vector3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | normal | |
| Vector3 | point |
Plane(Vector3, Vector3, Vector3)
Creates a plane from three points.
The points are in counterclockwise order seen from in front of the plane.
Declaration
public Plane(Vector3 point1, Vector3 point2, Vector3 point3)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point1 | |
| Vector3 | point2 | |
| Vector3 | point3 |
Plane(Vector3, double)
Creates a plane from a normal and a distance.
Declaration
public Plane(Vector3 normal, double d0)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | normal | |
| double | d0 |
Plane(double, double, double, double)
Creates a plane from four doubles.
Declaration
public Plane(double x0, double y0, double z0, double d0)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x0 | |
| double | y0 | |
| double | z0 | |
| double | d0 |
Fields
View Sourced
Distance from origin.
Negative if the normal points away from the origin,
positive if the normal points toward the origin.
Declaration
public double d
Field Value
| Type | Description |
|---|---|
| double |
x
Plane normal
Declaration
public double x
Field Value
| Type | Description |
|---|---|
| double |
y
Plane normal
Declaration
public double y
Field Value
| Type | Description |
|---|---|
| double |
z
Plane normal
Declaration
public double z
Field Value
| Type | Description |
|---|---|
| double |
Properties
View SourceNormal
Gets/sets the normal of the plane.
Declaration
public Vector3 Normal { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Methods
View SourceAngle(Vector3, Vector3)
Computes the angle between the projection of two vectors onto the plane.
Declaration
public double Angle(Vector3 vector1, Vector3 vector2)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | vector1 | |
| Vector3 | vector2 |
Returns
| Type | Description |
|---|---|
| double |
Distance(Vector3)
Returns the distance between the plane and a point.
Declaration
public double Distance(Vector3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point |
Returns
| Type | Description |
|---|---|
| double | Positive if the point is in front of the plane, negative if it is behind the plane |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
View SourceIntersect(Vector3, Vector3, out Vector3)
Calculates if and where a straight line between two points intersects the plane.
Declaration
public bool Intersect(Vector3 point1, Vector3 point2, out Vector3 intersectionPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point1 | |
| Vector3 | point2 | |
| Vector3 | intersectionPoint | Intersection point |
Returns
| Type | Description |
|---|---|
| bool | True if the line intersects the plane between point1 and point2. |
Intersect(Vector3, Vector3, out Vector3, out double)
Calculates if and where a straight line between two points intersects the plane.
Declaration
public bool Intersect(Vector3 point1, Vector3 point2, out Vector3 intersectionPoint, out double intersectionParameter)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point1 | |
| Vector3 | point2 | |
| Vector3 | intersectionPoint | Intersection point |
| double | intersectionParameter | Returns the parameter value of the intersection point, or NaN if the line is parallel to the plane. |
Returns
| Type | Description |
|---|---|
| bool | True if the line intersects the plane between point1 and point2 |
IntersectRay(Ray, out Vector3)
Calculates the intersection between a Ray and the plane.
Declaration
public bool IntersectRay(Ray ray, out Vector3 intersectionPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray | ray | Ray |
| Vector3 | intersectionPoint | Intersection point |
Returns
| Type | Description |
|---|---|
| bool | True if the ray intersects the plane. |
MirrorMatrixFlip(Matrix4, Axis)
Mirrors a coordinate system (represented by a matrix) in the plane
and optionally inverts one axis to keep the handedness.
The matrix is assumed to be affine.
Declaration
public Matrix4 MirrorMatrixFlip(Matrix4 mat, Axis flipaxis)
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | mat | the matrix to be mirrored |
| Axis | flipaxis | Undefined - Mirror all axes, the handedness of the system will be changed |
Returns
| Type | Description |
|---|---|
| Matrix4 | Mirrored matrix |
MirrorMatrixKeep(Matrix4, Axis)
Mirrors a coordinate system (represented by a matrix) in the plane
and optionally switches two axes to keep the handedness.
The matrix is assumed to be affine.
Declaration
public Matrix4 MirrorMatrixKeep(Matrix4 mat, Axis keepaxis)
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | mat | |
| Axis | keepaxis | Undefined - Mirror all axes, the handedness of the system will be changed |
Returns
| Type | Description |
|---|---|
| Matrix4 | Mirrored matrix |
MirrorPoint(Vector3)
Mirrors a point in the plane.
Declaration
public Vector3 MirrorPoint(Vector3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point |
Returns
| Type | Description |
|---|---|
| Vector3 | Mirrored point |
MirrorVector(Vector3)
Mirrors a vector (direction) in the plane.
Declaration
public Vector3 MirrorVector(Vector3 vec)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | vec |
Returns
| Type | Description |
|---|---|
| Vector3 | Mirrored vector |
ProjectPoint(Vector3)
Projects a point onto the plane.
Declaration
public Vector3 ProjectPoint(Vector3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point |
Returns
| Type | Description |
|---|---|
| Vector3 | Projected point |
ProjectVector(Vector3)
Projects a vector into the plane.
Declaration
public Vector3 ProjectVector(Vector3 vector)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | vector | Vector to project |
Returns
| Type | Description |
|---|---|
| Vector3 | Projected vector |
ToString()
Returns a string in the format[x y z d]
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
View SourceToString(IFormatProvider)
Returns a string in the format[x y z d]
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | formatProvider |
Returns
| Type | Description |
|---|---|
| string |
Operators
View Sourceoperator ==(Plane, Plane)
Equality operator
Declaration
public static bool operator ==(Plane lhs, Plane rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| Plane | lhs | |
| Plane | rhs |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(Plane, Plane)
Inequality operator
Declaration
public static bool operator !=(Plane lhs, Plane rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| Plane | lhs | |
| Plane | rhs |
Returns
| Type | Description |
|---|---|
| bool |