コード例 #1
0
        public SphereVector WalkTowardsPortion(SphereVector v, double portion)
        {
            double distance = this.Distance(v);

            if (distance < 0.001) // currently has precision issues
            {
                return(new SphereVector(((1 - portion) * this + portion * v).Normalized()));
            }
            else
            {
                return(WalkTowards(v, this.Distance(v) * portion));
            }
        }
コード例 #2
0
 internal SphereVector FlipOver(SphereVector v)
 {
     return(this.WalkTowards(v, 2 * this.Distance(v)));
 }
コード例 #3
0
 public double Distance(SphereVector v)
 {
     return(Math.Asin(this.Cross(v).Length()));
 }
コード例 #4
0
        public SphereVector WalkTowards(SphereVector v, double radians)
        {
            Vector3d D_tick = ((this.Cross(v).Cross(this)).Normalized()); // 90 degrees rotated towards v

            return(new SphereVector(Math.Cos(radians) * this + Math.Sin(radians) * D_tick));
        }