Documentation

Unity Engine

Download Unity

Unity Engine

projectonplane

Returns the projection of a onto the line through the origin that is perpendicular to planeNormal.
Read time 3 minutesLast updated 5 days ago

Definition

projectonplane(float2, float2)

Returns the projection of a onto the line through the origin that is perpendicular to planeNormal.
public static float2 projectonplane(float2 a, float2 planeNormal)

Parameters

Vector to project.

planeNormal

Non-zero normal of the line to project onto.

Returns

Type

Description

float2The projection of a onto the line perpendicular to planeNormal.

Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call math.projectonplanesafe which will use a given default value if the result is not finite.

projectonplane(float3, float3)

Returns the projection of a onto the plane through the origin with normal planeNormal.
public static float3 projectonplane(float3 a, float3 planeNormal)

Parameters

Vector to project.

planeNormal

Non-zero normal of the plane to project onto.

Returns

Type

Description

float3The projection of a onto the plane.

Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call math.projectonplanesafe which will use a given default value if the result is not finite.

projectonplane(float4, float4)

Returns the projection of a onto the hyperplane through the origin with normal planeNormal.
public static float4 projectonplane(float4 a, float4 planeNormal)

Parameters

Vector to project.

planeNormal

Non-zero normal of the hyperplane to project onto.

Returns

Type

Description

float4The projection of a onto the hyperplane.

Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call math.projectonplanesafe which will use a given default value if the result is not finite.

projectonplane(double2, double2)

Returns the projection of a onto the line through the origin that is perpendicular to planeNormal.
public static double2 projectonplane(double2 a, double2 planeNormal)

Parameters

Vector to project.

planeNormal

Non-zero normal of the line to project onto.

Returns

Type

Description

double2The projection of a onto the line perpendicular to planeNormal.

Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call math.projectonplanesafe which will use a given default value if the result is not finite.

projectonplane(double3, double3)

Returns the projection of a onto the plane through the origin with normal planeNormal.
public static double3 projectonplane(double3 a, double3 planeNormal)

Parameters

Vector to project.

planeNormal

Non-zero normal of the plane to project onto.

Returns

Type

Description

double3The projection of a onto the plane.

Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call math.projectonplanesafe which will use a given default value if the result is not finite.

projectonplane(double4, double4)

Returns the projection of a onto the hyperplane through the origin with normal planeNormal.
public static double4 projectonplane(double4 a, double4 planeNormal)

Parameters

Vector to project.

planeNormal

Non-zero normal of the hyperplane to project onto.

Returns

Type

Description

double4The projection of a onto the hyperplane.

Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call math.projectonplanesafe which will use a given default value if the result is not finite.