当前位置: 首页>>代码示例>>C#>>正文


C# Scientrace.trico方法代码示例

本文整理汇总了C#中Scientrace.trico方法的典型用法代码示例。如果您正苦于以下问题:C# Scientrace.trico方法的具体用法?C# Scientrace.trico怎么用?C# Scientrace.trico使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Scientrace的用法示例。


在下文中一共展示了Scientrace.trico方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createBetween3LocationsPointingTo

 public static PlaneBorder createBetween3LocationsPointingTo(Scientrace.Location baseLoc, Scientrace.Location loc2, Scientrace.Location loc3, Scientrace.Location pointingToLoc)
 {
     Vector v1 = (loc2-baseLoc).tryToUnitVector();
     Vector v2 = (loc3-baseLoc).tryToUnitVector();
     NonzeroVector tryNormal = v1.crossProduct(v2).tryToNonzeroVector();
     //Console.WriteLine("V1: "+v1.trico()+" v2:"+v2.trico()+" trynormal:"+tryNormal.trico());
     PlaneBorder tryBorder = new PlaneBorder(baseLoc, tryNormal);
     if (tryBorder.contains(pointingToLoc))
     return tryBorder;
     tryBorder = new PlaneBorder(baseLoc, tryNormal.negative());
     if (tryBorder.contains(pointingToLoc))
     return tryBorder;
     throw new Exception("Couldn't create PlaneBorder containing "+pointingToLoc.trico());
 }
开发者ID:JoepBC,项目名称:scientrace,代码行数:14,代码来源:PlaneBorder.cs

示例2: 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);
        }
开发者ID:JoepBC,项目名称:scientrace,代码行数:21,代码来源:PlanoConvexLens.cs

示例3: ParallelVectorException

 public ParallelVectorException(Scientrace.Vector vec1, Scientrace.Vector vec2, string str)
 {
     Console.WriteLine("Two vectors ("+vec1.trico()+" / "+vec2.trico()+") are parallel which is not allowed. "+str);
 }
开发者ID:JoepBC,项目名称:scientrace,代码行数:4,代码来源:ParallelVectorException.cs

示例4: getX3DTranslationTag

 public string getX3DTranslationTag(Scientrace.Location loc)
 {
     return "<Transform translation='"+loc.trico()+"'>";
 }
开发者ID:JoepBC,项目名称:scientrace,代码行数:4,代码来源:X3DShapeDrawer.cs

示例5: get_RGB_Line_XML

 public static string get_RGB_Line_XML(Scientrace.Location loc1, Scientrace.Location loc2, string colourRGBstring)
 {
     if (loc1 == null || loc2 == null) {
     return "";
     }
     return @"<!--RGBA_Line--><Shape><LineSet vertexCount='2'><Coordinate point='"+loc2.trico()+" \t"+loc1.trico()[email protected]"' />"+
     "<Color color='"+colourRGBstring+" \t"[email protected]"' /></LineSet></Shape>";
 }
开发者ID:JoepBC,项目名称:scientrace,代码行数:8,代码来源:X3DGridPoint.cs

示例6: x3D_Sphere

        public static string x3D_Sphere(Scientrace.Location aLoc, double radius, string sphere_colour, double sphere_colour_intensity)
        {
            if ((aLoc == null) || !aLoc.isValid()) {
            throw new Exception("NULLS OR NANS DETECTED");
            }
            if (radius <= 0) return ""; // no sphere with no radius
            string transpstr = (sphere_colour_intensity < 1) ? " transparency='"+(1-Math.Sqrt(sphere_colour_intensity))+"'" : "";/*Sqrt for visibility */

            return @"<!--X3DSphere -->
            <Transform scale='"+radius+" "+radius+" "[email protected]"' translation='"+aLoc.trico()[email protected]"'>
            <Shape><Sphere />
            <Appearance><Material emissiveColor='"[email protected]"'"[email protected]" /></Appearance>
            </Shape></Transform><!-- End X3DSphere -->";
        }
开发者ID:JoepBC,项目名称:scientrace,代码行数:14,代码来源:X3DGridPoint.cs


注:本文中的Scientrace.trico方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。