Exemplo n.º 1
0
        /////////////INTERSECTION_METHODS//////////////
        ///////////////////////////////////////////////
        ////////////////TANGENT_METHODS////////////////

        public override GlLineR2 getTangentFromBelongs(GlPointR2 P)
        {
            if (P == null || !this.isPointBelongs(P))
            {
                return(new GlLineR2(new GlPointR2(null), new GlVectorR2(null)));
            }

            GlPointR2 TP = P.getPointTranslatedToRotatedSystem(this.SIN, this.COS, this.Center);
            float     k  = (TP.Y >= 0 ? 1 : -1) * AdditionalHalfAixis * TP.X / (RealHalfAixis * (float)Math.Sqrt(TP.X * TP.X - Math.Pow(RealHalfAixis, 2.0)));

            GlLineR2 tangent = new GlLineR2(P, new GlVectorR2(1, 0).getRotatedVector((float)Math.Atan(k)));

            tangent.Rotate(this.SIN, this.COS);
            return(tangent);
        }
Exemplo n.º 2
0
        /////////////INTERSECTION_METHODS//////////////
        ///////////////////////////////////////////////
        ////////////////TANGENT_METHODS////////////////

        public override GlLineR2 getTangentFromBelongs(GlPointR2 P)
        {
            if (P == null || P.isNullPoint())
            {
                return(new GlLineR2(new GlPointR2(null), new GlVectorR2(null)));
            }

            GlParabola TPB = new GlParabola(this.A, new GlPointR2(0, 0), new GlVectorR2(1, 0));
            GlPointR2  TP  = P.getPointTranslatedToRotatedSystem(this.SIN, this.COS, this.Vertex);

            float k = 2 * TPB.A * TP.X + TPB.B;

            GlLineR2 tangent = new GlLineR2(P, new GlVectorR2(1, 0).getRotatedVector((float)Math.Atan(k)));

            tangent.Rotate(this.SIN, this.COS);
            return(tangent);
        }
Exemplo n.º 3
0
        public override GlLineR2 getTangentFromBelongs(GlPointR2 P)
        {
            if (P == null || P.isNullPoint() || !this.isPointBelongs(P) || this.RadA == 0.0f)
            {
                return(new GlLineR2(new GlPointR2(null), new GlVectorR2(null)));
            }

            GlOval    IO         = new GlOval(this.RadA, this.RadB, new GlVectorR2(this.RadA, 0.0f), new GlPointR2(0.0f, 0.0f));
            GlPointR2 MovedPoint = P.getPointTranslatedToRotatedSystem(this.SIN, this.COS, new GlPointR2(this.CenterX, this.CenterY));

            GlLineR2 tangent = new GlLineR2(MovedPoint, new GlVectorR2(-(float)Math.Pow(this.RadA, 2.0) * MovedPoint.Y, (float)Math.Pow(this.RadB, 2.0) * MovedPoint.X));

            tangent.Rotate(this.SIN, this.COS);
            tangent.moveTo(P);

            return(tangent);
        }