VectorUtility¶
Namespace:
SideXP.Core
Miscellaneous functions for working with vectors.
Methods¶
Barycentre(IList<Vector3>)¶
Computes the barycentre of the given points. Barycentre formula:
. -> ->
-> weightA * OA + weightN... * ON...
OG = ___________________________________
. weightA + weightN...
Parameters
points: The points from which you want to compute the barycentre.
Returns
Returns the computed barycentre.
Barycentre(IList<Vector2>)¶
Computes the barycentre of the given points. Barycentre formula:
. -> ->
-> weightA * OA + weightN... * ON...
OG = ___________________________________
. weightA + weightN...
Parameters
points: The points from which you want to compute the barycentre.
Returns
Returns the computed barycentre.
Barycentre(IList<(Vector3, float)>)¶
Computes the barycentre of the given points. Barycentre formula:
. -> ->
-> weightA * OA + weightN... * ON...
OG = ___________________________________
. weightA + weightN...
Parameters
weightedPoints: The points from which you want to compute the barycentre, and their associated weight. The more the weight value, the closer the barycentre to this point.
Returns
Returns the computed barycentre.
Barycentre(IList<(Vector2, float)>)¶
Parameters
weightedPoints: The points from which you want to compute the barycentre, and their associated weight. The more the weight value, the closer the barycentre to this point.