Show / Hide Table of Contents

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 Source

Plane(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

View Source

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
View Source

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
View Source

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
View Source

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 Source

d

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
View Source

x

Plane normal

Declaration
public double x
Field Value
Type Description
double
View Source

y

Plane normal

Declaration
public double y
Field Value
Type Description
double
View Source

z

Plane normal

Declaration
public double z
Field Value
Type Description
double

Properties

View Source

Normal

Gets/sets the normal of the plane.

Declaration
public Vector3 Normal { get; set; }
Property Value
Type Description
Vector3

Methods

View Source

Angle(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
View Source

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

View Source

Equals(object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
ValueType.Equals(object)
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

Intersect(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.

View Source

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

View Source

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.

View Source

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
X - Invert x axis to keep handedness
Y - Invert y axis to keep handedness
Z - Invert z axis to keep handedness

Returns
Type Description
Matrix4

Mirrored matrix

View Source

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
X - Keep x, switch y and z axes to keep handedness
Y - Keep y, switch x and z axes to keep handedness
Z - Keep z, Switch y and z axes to keep handedness

Returns
Type Description
Matrix4

Mirrored matrix

View Source

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

View Source

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

View Source

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

View Source

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

View Source

ToString()

Returns a string in the format
[x y z d]

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
ValueType.ToString()
View Source

ToString(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 Source

operator ==(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
View Source

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
  • View Source
In this article
Back to top Copyright © 2025 ABB