示例#1
0
文件: Vector.cs 项目: 15831944/habile
        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);
        }
示例#2
0
文件: Line.cs 项目: 15831944/habile
        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);
            }
        }