本文整理汇总了C#中Vector2f.GetLength方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2f.GetLength方法的具体用法?C# Vector2f.GetLength怎么用?C# Vector2f.GetLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector2f
的用法示例。
在下文中一共展示了Vector2f.GetLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Symmetric
public Symmetric(CurvePath curve, Vector2f [] axis)
{
Debug.Assert((axis[0].X == axis[1].X || axis[0].Y == axis[1].Y) &&
(axis[0].X != axis[1].X || axis[0].Y != axis[1].Y),
"Simetría con respecto a ejes no ortogonales no soportada");
Debug.Assert(axis.GetLength(0) == 2, "Eje mal expresado");
_coef = new float [2*curve.NumSegments,5];
for (int seg = 0; seg < curve.NumSegments; seg++)
{
// simetría vertical
if (axis[0].X == axis[1].X)
{
_coef[2 * seg, 0] = 2*axis[0].X - curve.Coefficients[2 * seg, 0];
_coef[2 * seg + 1, 0] = curve.Coefficients[2 * seg + 1, 0];
}
else
{
_coef[2 * seg, 0] = curve.Coefficients[2 * seg, 0];
_coef[2 * seg + 1, 0] = 2 * axis[0].Y - curve.Coefficients[2 * seg + 1, 0]; ;
}
// copio la longitud
_coef[2 * seg + 1, 4] = _coef[2 * seg, 4] = curve.Coefficients[2 * seg, 4];
for (int grade=1;grade<4;grade++)
{
// simetría vertical
if (axis[0].X == axis[1].X)
{
_coef[2 * seg, grade] = -1 * curve.Coefficients[2 * seg, grade];
_coef[2 * seg + 1, grade] = curve.Coefficients[2 * seg + 1, grade];
}
else // simetría horizontal
{
_coef[2 * seg, grade] = curve.Coefficients[2 * seg, grade];
_coef[2 * seg + 1, grade] = -1 * curve.Coefficients[2 * seg + 1, grade];
}
}
}
_totalLength = curve.Length;
}