Example #1
0
        public Vector rotate(double rad)
        {
            Polar  d     = Converter.xy_to_la(this);
            Polar  new_d = d.rotate(rad);
            Vector new_v = Converter.la_to_xy(new_d);

            return(new_v);
        }
Example #2
0
        public Vector getCoolVector(Vector one)
        {
            Polar main   = Converter.xy_to_la(one);
            Polar other1 = Converter.xy_to_la(getDirectionVector());
            Polar other2 = other1.rotate(Math.PI);

            if (Converter.AngleDelta(main.angle, other1.angle) < Converter.AngleDelta(main.angle, other2.angle))
            {
                Vector v1 = Converter.la_to_xy(other1);
                return(v1);
            }
            else
            {
                Vector v1 = Converter.la_to_xy(other2);
                return(v1);
            }
        }