Beispiel #1
0
        static public Vektor2DDouble NääxterPunktAufGeraade(
            Vektor2DDouble GeradeRichtung,
            Vektor2DDouble Punkt)
        {
            GeradeRichtung.Normalisiire();

            var PositionAufGerade = Punkt.A * GeradeRichtung.A + Punkt.B * GeradeRichtung.B;

            return(new Vektor2DDouble(GeradeRichtung.A * PositionAufGerade, GeradeRichtung.B * PositionAufGerade));
        }
Beispiel #2
0
        /// <summary>
        /// Winkel(0) => (a=1,b=0)
        /// Winkel(1/4) => (a=0,b=1)
        /// Winkel(2/4) => (a=-1,b=0)
        /// Winkel(3/4) => (a=0,b=-1)
        /// </summary>
        /// <param name="Vektor"></param>
        static public double Rotatioon(Vektor2DDouble Vektor)
        {
            Vektor.Normalisiire();

            var Winkel = Math.Acos(Vektor.A) / Math.PI / 2;

            if (Vektor.B < 0)
            {
                Winkel = 1 - Winkel;
            }

            return(Winkel);
        }