Closest Point On Sphere

Pure
ClosestPointOnSphere

Returns the closest point on a sphere's surface to a given point.

Type: Pure (no side effects)
Category: Fortuna|Vector & Transform
Keywords: vector & transform

Inputs

NameTypeDefaultDescription
PointFVectorPoint parameter
SphereCenterFVectorSphereCenter parameter
SphereRadiusfloatSphereRadius parameter

Outputs

NameTypeDescription
ReturnValueFVectorReturnValue output

Example Use Cases

Example 1

Clamp an orbiting camera to a spherical boundary.

Example 2

Find the nearest surface point on a planet.