本文整理汇总了C#中Scientrace.normalizedVector方法的典型用法代码示例。如果您正苦于以下问题:C# Scientrace.normalizedVector方法的具体用法?C# Scientrace.normalizedVector怎么用?C# Scientrace.normalizedVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scientrace
的用法示例。
在下文中一共展示了Scientrace.normalizedVector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateWithLensDiameter
// Factory method: lensFlatCenterLoc, sphereRadius, lensDiameter
public static Scientrace.PlanoConvexLens CreateWithLensDiameter(Scientrace.Object3dCollection parent,
Scientrace.MaterialProperties mprops,
Scientrace.Location lensFlatCenterLoc, double lensDiameter,
Scientrace.NonzeroVector sphereRadiusVec)
{
Scientrace.PlaneBorder aPlane = new PlaneBorder(lensFlatCenterLoc, sphereRadiusVec);
double r /*sphere radius*/ = sphereRadiusVec.length;
double x /*lens radius*/ = lensDiameter/2;
double y /*distance lens center to sphere center*/ = Math.Sqrt((r*r)-(x*x));
double t /*thickness*/ = r-y;
//Console.WriteLine("sphereradius: "+r+" lens thickness: "+t+" y:"+y+" x:"+x);
if (t<=0) {
throw new Exception("This PlanoConvexLens cannot be created: "+sphereRadiusVec.trico()+"/"+lensDiameter);
}
Scientrace.Location sphereLoc = lensFlatCenterLoc - (sphereRadiusVec.normalizedVector()*y);
//Console.WriteLine("sphereLoc: "+sphereLoc.trico()+" lensFlatCenterLoc: "+t+" lensFlatCenterLoc:"+lensFlatCenterLoc.trico());
return new PlanoConvexLens(parent, mprops, aPlane, sphereLoc, r);
}
示例2: initWithLensDiameter
// Factory method: lensFlatCenterLoc, sphereRadius, lensDiameter
public void initWithLensDiameter(Scientrace.Location lensPlaneCenterLoc, Scientrace.NonzeroVector lensPlaneNormal,
double lensDiameter, double sphere1Radius, double sphere2Radius)
{
//Console.WriteLine("New lens: Loc: "+lensPlaneCenterLoc.trico()+" normal: "+lensPlaneNormal.trico()+" diameter:"+lensDiameter+" r1:"+sphere1Radius+" r2:"+sphere2Radius);
//Scientrace.PlaneBorder aPlane = new PlaneBorder(lensPlaneCenterLoc, lensPlaneNormal);
double r1 /*sphere radius*/ = sphere1Radius;
double r2 /*sphere radius*/ = sphere2Radius;
double x /*lens radius*/ = lensDiameter/2;
if ((x > r1) || (x > r2)) {
throw new Exception("DoubleConvexLens cannot be created, on of sphere radii is larger than lens radius: "+r1+"|"+r2+" > "+x);
}
/* y => distance lens center to sphere center*/
double y1 = Math.Sqrt((r1*r1)-(x*x));
double y2 = Math.Sqrt((r2*r2)-(x*x));
Scientrace.Location sphere1Loc = lensPlaneCenterLoc - (lensPlaneNormal.normalizedVector()*y1);
Scientrace.Location sphere2Loc = lensPlaneCenterLoc + (lensPlaneNormal.normalizedVector()*y2);
//Console.WriteLine("sphereLoc: "+sphere1Loc.trico()+"/"+sphere2Loc.trico());
//+ " lensFlatCenterLoc: "+t+" lensFlatCenterLoc:"+lensFlatCenterLoc.trico());
this.paramInit(sphere1Loc, r1, sphere2Loc, r2);
}
示例3: getSphericalLoc
public Location getSphericalLoc(Scientrace.NonzeroVector xvec, Scientrace.NonzeroVector yvec,
Scientrace.NonzeroVector zvec,
Scientrace.Vector sphereCenter, double sphereRadius,
double theta, double phi)
{
return this.getEllipsoidLoc(
xvec.normalizedVector()*sphereRadius,
yvec.normalizedVector()*sphereRadius,
zvec.normalizedVector()*sphereRadius,
sphereCenter, theta, phi);
}