DistanceToPlane

Returns the distance from a 3-D point to a plane.

Syntax

Rhino.DistanceToPlane (arrPlane, arrPoint)

Parameters

arrPlane

Required.  Array.  The plane.  The elements of a plane array are as follows:

Element

Description

0

Required.  The plane's origin (3-D point).

1

Required.  The plane's X axis direction (3-D vector).

2

Required.  The plane's Y axis direction (3-D vector).

3

Optional.  The plane's Z axis direction (3-D vector).

arrPoint

Required.  Array.  The 3-D point.

Returns

Number

The distance if successful.

Null

If not successful, or on error.

Example

Dim arrPlane, arrPoint, dblDistance

arrPoint = Rhino.GetPoint("Point to test")

If IsArray(arrPoint) Then

  arrPlane = Rhino.ViewCPlane

  If IsArray(arrPlane) Then

    dblDistance = Rhino.DistanceToPlane(arrPlane, arrPoint)

    If Not IsNull(dblDistance) Then

      Rhino.Print "Distance to plane: " & CStr(dblDistance)

    End If

  End If

End If

Also See

Distance

PlaneClosestPoint