Method projectsafe
projectsafe(float2, float2, float2)
Compute vector projection of a onto b. If result is not finite, then return the default value instead.
Declaration
public static float2 projectsafe(float2 a, float2 b, float2 defaultValue = default(float2))
Parameters
Type | Name | Description |
---|---|---|
float2 | a | Vector to project. |
float2 | b | Non-zero vector to project onto. |
float2 | defaultValue | Default value to return if projection is not finite. |
Returns
Type | Description |
---|---|
float2 | Vector projection of a onto b or the default value. |
Remarks
This function performs extra checks to see if the result of projecting a onto b is finite. If you know that your inputs will generate a finite result or you don't care if the result is finite, then you can call project(float2, float2) instead which is faster than this function.
projectsafe(float3, float3, float3)
Compute vector projection of a onto b. If result is not finite, then return the default value instead.
Declaration
public static float3 projectsafe(float3 a, float3 b, float3 defaultValue = default(float3))
Parameters
Type | Name | Description |
---|---|---|
float3 | a | Vector to project. |
float3 | b | Non-zero vector to project onto. |
float3 | defaultValue | Default value to return if projection is not finite. |
Returns
Type | Description |
---|---|
float3 | Vector projection of a onto b or the default value. |
Remarks
This function performs extra checks to see if the result of projecting a onto b is finite. If you know that your inputs will generate a finite result or you don't care if the result is finite, then you can call project(float3, float3) instead which is faster than this function.
projectsafe(float4, float4, float4)
Compute vector projection of a onto b. If result is not finite, then return the default value instead.
Declaration
public static float4 projectsafe(float4 a, float4 b, float4 defaultValue = default(float4))
Parameters
Type | Name | Description |
---|---|---|
float4 | a | Vector to project. |
float4 | b | Non-zero vector to project onto. |
float4 | defaultValue | Default value to return if projection is not finite. |
Returns
Type | Description |
---|---|
float4 | Vector projection of a onto b or the default value. |
Remarks
This function performs extra checks to see if the result of projecting a onto b is finite. If you know that your inputs will generate a finite result or you don't care if the result is finite, then you can call project(float4, float4) instead which is faster than this function.
projectsafe(double2, double2, double2)
Compute vector projection of a onto b. If result is not finite, then return the default value instead.
Declaration
public static double2 projectsafe(double2 a, double2 b, double2 defaultValue = default(double2))
Parameters
Type | Name | Description |
---|---|---|
double2 | a | Vector to project. |
double2 | b | Non-zero vector to project onto. |
double2 | defaultValue | Default value to return if projection is not finite. |
Returns
Type | Description |
---|---|
double2 | Vector projection of a onto b or the default value. |
Remarks
This function performs extra checks to see if the result of projecting a onto b is finite. If you know that your inputs will generate a finite result or you don't care if the result is finite, then you can call project(double2, double2) instead which is faster than this function.
projectsafe(double3, double3, double3)
Compute vector projection of a onto b. If result is not finite, then return the default value instead.
Declaration
public static double3 projectsafe(double3 a, double3 b, double3 defaultValue = default(double3))
Parameters
Type | Name | Description |
---|---|---|
double3 | a | Vector to project. |
double3 | b | Non-zero vector to project onto. |
double3 | defaultValue | Default value to return if projection is not finite. |
Returns
Type | Description |
---|---|
double3 | Vector projection of a onto b or the default value. |
Remarks
This function performs extra checks to see if the result of projecting a onto b is finite. If you know that your inputs will generate a finite result or you don't care if the result is finite, then you can call project(double3, double3) instead which is faster than this function.
projectsafe(double4, double4, double4)
Compute vector projection of a onto b. If result is not finite, then return the default value instead.
Declaration
public static double4 projectsafe(double4 a, double4 b, double4 defaultValue = default(double4))
Parameters
Type | Name | Description |
---|---|---|
double4 | a | Vector to project. |
double4 | b | Non-zero vector to project onto. |
double4 | defaultValue | Default value to return if projection is not finite. |
Returns
Type | Description |
---|---|
double4 | Vector projection of a onto b or the default value. |
Remarks
This function performs extra checks to see if the result of projecting a onto b is finite. If you know that your inputs will generate a finite result or you don't care if the result is finite, then you can call project(double4, double4) instead which is faster than this function.