﻿Plane.ClosestParameter Method

Gets the parameters of the point on the plane closest to a test point.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 5.0
Syntax
```public bool ClosestParameter(
Point3d testPoint,
out double s,
out double t
)```

#### Parameters

testPoint
Type: Rhino.GeometryPoint3d
Point to get close to.
s
Type: SystemDouble
Parameter along plane X-direction.
t
Type: SystemDouble
Parameter along plane Y-direction.

#### Return Value

Type: Boolean
true if a parameter could be found, false if the point could not be projected successfully.
Examples
```using System;
using Rhino.Geometry;

partial class Examples
{
{
Point3d origin = new Point3d(1,1,0);
Point3d offset = new Point3d(11,1,0);
Point3d pt = new Point3d((offset.X-origin.X)/2,3,0);

Plane plane = Plane.WorldXY;
plane.Origin = origin;

double u,v;
plane.ClosestParameter(origin, out u, out v);
Point2d ext1 = new Point2d(u, v);

plane.ClosestParameter(offset, out u, out v);
Point2d ext2 = new Point2d(u, v);

plane.ClosestParameter(pt, out u, out v);
Point2d linePt = new Point2d(u, v);

LinearDimension dimension = new LinearDimension(plane, ext1, ext2, linePt);
{
doc.Views.Redraw();
return Rhino.Commands.Result.Success;
}
return Rhino.Commands.Result.Failure;
}
}```
Python
```import Rhino
import scriptcontext
import System.Guid

origin = Rhino.Geometry.Point3d(1,1,0)
offset = Rhino.Geometry.Point3d(11,1,0)
pt = Rhino.Geometry.Point3d((offset.X-origin.X)/2.0,3,0)
plane = Rhino.Geometry.Plane.WorldXY
plane.Origin = origin

rc, u, v = plane.ClosestParameter(origin)
ext1 = Rhino.Geometry.Point2d(u,v)
rc, u, v = plane.ClosestParameter(offset)
ext2 = Rhino.Geometry.Point2d(u,v)
rc, u, v = plane.ClosestParameter(pt)
linePt = Rhino.Geometry.Point2d(u,v)

dimension = Rhino.Geometry.LinearDimension(plane, ext1, ext2, linePt)
scriptcontext.doc.Views.Redraw()
return Rhino.Commands.Result.Success
return Rhino.Commands.Result.Failure

if __name__=="__main__":