本文整理汇总了C#中GeometryAPI.Vector3D类的典型用法代码示例。如果您正苦于以下问题:C# Vector3D类的具体用法?C# Vector3D怎么用?C# Vector3D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Vector3D类属于GeometryAPI命名空间,在下文中一共展示了Vector3D类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Circle
// Constructor
public Circle(Vector3D center, double radius)
: base(center)
{
this.Radius = radius;
A = new Vector3D(center.X + this.Radius, center.Y, center.Z);
B = new Vector3D(center.X, center.Y + this.Radius, center.Z);
}
示例2: Translate
public void Translate(Vector3D translationVector)
{
for (int i = 0; i < this.vertices.Count; i++)
{
this.vertices[i] += translationVector;
}
}
示例3: CrossProduct
public static Vector3D CrossProduct(Vector3D a, Vector3D b)
{
double crossX = a.Y * b.Z - a.Z * b.Y;
double crossY = a.Z * b.X - a.X * b.Z;
double crossZ = a.X * b.Y - a.Y * b.X;
return new Vector3D(crossX, crossY, crossZ);
}
示例4: GetNormal
public Vector3D GetNormal()
{
Vector3D center = this.GetCenter();
Vector3D A = new Vector3D(center.X + this.Radius, center.Y, center.Z);
Vector3D B = new Vector3D(center.X, center.Y + this.Radius, center.Z);
Vector3D normal = Vector3D.CrossProduct(center - A, center - B);
normal.Normalize();
return normal;
}
示例5: Scale
public void Scale(Vector3D scaleCenter, double scaleFactor)
{
for (int i = 0; i < this.vertices.Count; i++)
{
Vector3D centeredCurrent = this.vertices[i] - scaleCenter;
Vector3D scaledCenteredCurrent = centeredCurrent * scaleFactor;
this.vertices[i] = scaledCenteredCurrent + scaleCenter;
}
}
示例6: DotProduct
public static double DotProduct(Vector3D a, Vector3D b)
{
double result = 0;
for (int d = 0; d < 3; d++)
{
result += a[d] * b[d];
}
return result;
}
示例7: GetCenter
// Methods
public virtual Vector3D GetCenter()
{
Vector3D verticesSum = new Vector3D(0, 0, 0);
for (int i = 0; i < this.vertices.Count; i++)
{
verticesSum += this.vertices[i];
}
return verticesSum / this.vertices.Count;
}
示例8: RotateInXY
public void RotateInXY(Vector3D rotCenter, double angleDegrees)
{
for (int i = 0; i < this.vertices.Count; i++)
{
Vector3D centeredCurrent = this.vertices[i] - rotCenter;
double angleRads = angleDegrees * Math.PI / 180.0;
Vector3D rotatedCenteredCurrent = new Vector3D(
centeredCurrent.X * Math.Cos(angleRads) - centeredCurrent.Y * Math.Sin(angleRads),
centeredCurrent.X * Math.Sin(angleRads) + centeredCurrent.Y * Math.Cos(angleRads),
centeredCurrent.Z);
this.vertices[i] = rotatedCenteredCurrent + rotCenter;
}
}
示例9: Cylinder
public Cylinder(Vector3D botCirc, Vector3D topCirc, double radius)
: base(botCirc, topCirc)
{
this.Radius = radius;
}
示例10: Cylinder
public Cylinder(Vector3D centerBottom, Vector3D centerTop, double radius)
: base(centerBottom, centerTop)
{
this.Radius = radius;
}
示例11: Circle
public Circle(Vector3D center, double radius)
: base(center)
{
this.Radisu = radius;
}
示例12: Vertex
public Vertex(Vector3D location)
: base(location)
{
}
示例13: Triangle
public Triangle(Vector3D a, Vector3D b, Vector3D c)
: base(a, b, c)
{
}
示例14: Cylinder
public Cylinder(Vector3D bottomCenter, Vector3D topCenter, double radius)
: base(topCenter, bottomCenter)
{
this.BottomCenter = bottomCenter;
this.TopCenter = topCenter;
this.Radius = radius;
this.Height = (topCenter - bottomCenter).Magnitude;
}
示例15: Circle
public Circle(Vector3D centre, double radius)
: base(centre)
{
this.Radius = radius;
}