コード例 #1
0
        public double CrossProduct(FreeVector other)
        {
            Vector v = new Vector(_p.X, _p.Y);
            Vector u = new Vector(other._p.X, other._p.Y);

            //return this.X * other.Y - this.Y * other.X;

            return(Vector.CrossProduct(v, u));
        }
コード例 #2
0
        public bool IsApproxHorizontal()
        {
            //double angle = Math.Atan(_p.Y / _p.X);

            //return Math.Abs(angle) <= eps_deg;

            FreeVector v = this;

            v.Length = 1;

            return(Math.Abs(_p.Y) <= 5);
        }
コード例 #3
0
        public bool IsApproxVertical()
        {
            //double angle = Math.Atan(_p.Y / _p.X);

            //return Math.Abs(angle - (Math.PI / 2)) <= (eps_deg * 1.5);

            FreeVector v = this;

            v.Length = 1;

            return(Math.Abs(_p.X) <= 5);
        }
コード例 #4
0
 public float GetAngleWith(FreeVector other)
 {
     return((float)Vector.AngleBetween(new Vector(this.X, this.Y),
                                       new Vector(other.X, other.Y)));
 }
コード例 #5
0
 public Direction GetDirection(FreeVector v)
 {
     return(this.CrossProduct(v) >= 0 ? Direction.Anticlockwise
                                      : Direction.Clockwise);
 }