本文整理汇总了C#中Scientrace.fillOrtogonalVectors方法的典型用法代码示例。如果您正苦于以下问题:C# Scientrace.fillOrtogonalVectors方法的具体用法?C# Scientrace.fillOrtogonalVectors怎么用?C# Scientrace.fillOrtogonalVectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scientrace
的用法示例。
在下文中一共展示了Scientrace.fillOrtogonalVectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawSphereSlice
public StringBuilder drawSphereSlice(Scientrace.Object3d drawnObject3d, double lateral_circles, double meridians,
Scientrace.Sphere sphere, double from_radians, double to_radians,
Scientrace.UnitVector sliceAlongDirection)
{
System.Text.StringBuilder retx3d = new System.Text.StringBuilder(1024);//"<!-- DOUBLECONVEXLENS GRID start -->");
double pi2 = Math.PI*2;
NonzeroVector orthoBaseVec1 = null;
NonzeroVector orthoBaseVec2 = null;
sliceAlongDirection.fillOrtogonalVectors(ref orthoBaseVec1, ref orthoBaseVec2);
for (double iSphereCircle = 2*lateral_circles; iSphereCircle > 0; iSphereCircle--) { // the rings/parallels along the sliceAlongDirection axis
double lateral_radians = (to_radians * (iSphereCircle / (2*lateral_circles)));
double circle2DRadius = sphere.radius*Math.Sin(lateral_radians);
double circle2DDistance = sphere.radius*Math.Cos(lateral_radians);
retx3d.Append(this.drawCircle(sphere.loc+(sliceAlongDirection*circle2DDistance).toLocation(), circle2DRadius, sliceAlongDirection));
for (double iSphereMerid = 0.5; iSphereMerid < 2*meridians; iSphereMerid++) { // meridians connect the rings/circles on the spherical surface
Scientrace.Location tNodeLoc = sphere.getSphericalLoc(
orthoBaseVec1, orthoBaseVec2,
sliceAlongDirection,
to_radians * (iSphereCircle / (2*lateral_circles)), // lat_angle = theta
pi2 * (iSphereMerid/(2*meridians)) // mer_angle = phi
);
if (!tNodeLoc.isValid())
throw new NullReferenceException("Cannot calculate base gridpoint at @ "+drawnObject3d.tag);
Scientrace.Location tLatConnectLoc = sphere.getSphericalLoc(
orthoBaseVec1, orthoBaseVec2,
sliceAlongDirection,
to_radians * ((iSphereCircle-1) / (2*lateral_circles)), // lat_angle = theta
pi2 * ((iSphereMerid)/(2*meridians)) // mer_angle = phi
);
if (!tLatConnectLoc.isValid())
throw new NullReferenceException("Cannot calculate lateral gridpoint at @ "+drawnObject3d.tag);
Scientrace.X3DGridPoint tGridPoint = new Scientrace.X3DGridPoint(0, tNodeLoc, null, tLatConnectLoc);
retx3d.AppendLine(tGridPoint.exportX3DnosphereRGB(this.primaryRGB));
}} // end for iSphereCircle / iSphereMerid
return retx3d;
}