Exemplo n.º 1
0
        public TangentialPlanesTriangulation(GeoPoint2D[][] points, ISurface surface, double maxDeflection, Angle maxBending)
        {
            this.points        = points;
            this.surface       = surface;
            this.maxDeflection = maxDeflection;
            this.maxBending    = maxBending;
            allPlanes          = new List <TangentPlane>();

            for (int i = 0; i < points.Length; i++)
            {
                int first = allPlanes.Count;
                for (int j = 0; j < points[i].Length; j++)
                {
                    GeoPoint  location;
                    GeoVector udirection, vdirection;
                    surface.DerivationAt(points[i][j], out location, out udirection, out vdirection);
                    TangentPlane tp = new TangentPlane(this, points[i][j], location, udirection, vdirection);
                    allPlanes.Add(tp);
                    if (j > 0)
                    {
                        tp.IntersectWith(allPlanes[first + j - 1], true);        // schneiden mit der vorherigen
                    }
                }
                allPlanes[allPlanes.Count - 1].IntersectWith(allPlanes[first], true);
            }
        }
Exemplo n.º 2
0
        private void GetOnPlateCoordinates(double raDeg, double deDeg, ModelConfig modelConfig, out double x, out double y)
        {
            double tangentalX, tangentalY;

            TangentPlane.CelestialToTangent(raDeg, deDeg, modelConfig.RADeg2000, modelConfig.DEDeg2000, out tangentalX, out tangentalY);

            tangentalY = -tangentalY;

            double plateX = tangentalX * (modelConfig.PlateFocLength * 1000.0 / modelConfig.PlatePixWidth);
            double plateY = tangentalY * (modelConfig.PlateFocLength * 1000.0 / modelConfig.PlatePixHeight);

            double mtxX = Math.Cos(modelConfig.PlateRotAngleRadians) * plateX + Math.Sin(modelConfig.PlateRotAngleRadians) * plateY;
            double mtxY = Math.Cos(modelConfig.PlateRotAngleRadians) * plateY - Math.Sin(modelConfig.PlateRotAngleRadians) * plateX;

            x = (modelConfig.FrameWidth / 2) + mtxX * modelConfig.MatrixToImageScaleX;
            y = (modelConfig.FrameHeight / 2) + mtxY * modelConfig.MatrixToImageScaleY;
        }
Exemplo n.º 3
0
            internal bool IntersectWith(TangentPlane other, bool onEdge)
            {
                GeoVector common = this.normal ^ other.normal;

                if (common.IsNullVector())
                {
                    return(false);
                }
                GeoVector perp  = other.normal ^ common;   // Vektor senkrecht zur Schnittrichtung und in anderer Ebene
                GeoPoint  oloc  = toThis * other.location; // anderer Nullpunkt in diesem System
                GeoVector operp = toThis * perp;           // senkrechter Vektor in diesem System
                double    l     = oloc.z / operp.z;
                GeoPoint  ip    = oloc + l * operp;        // Schnittpunkt in diesem System (z muss 0 sein)

                lineStartPoint.Add(new GeoPoint2D(ip));
                lineDirection.Add(new GeoVector2D(toThis * common));
                this.other.Add(other);
                GeoPoint2D sp;

                other.AddLine(new GeoPoint2D(other.toThis * to3d(new GeoPoint2D(ip))), new GeoVector2D(-(other.toThis * common)), this);
                return(true);
            }
Exemplo n.º 4
0
 private void AddLine(GeoPoint2D sp, GeoVector2D dir, TangentPlane other)
 {
     this.lineStartPoint.Add(sp);
     this.lineDirection.Add(dir);
     this.other.Add(other);
 }