public Vector3D ReflectPoint( Vector3D p )
{
if( IsPlane )
{
//Debug.Assert( !Infinity.IsInfinite( p ) );
Vector3D v = Euclidean3D.ProjectOntoPlane( this.Normal, this.Offset, p );
v = p + (v - p)*2;
return v;
}
else
{
if( p == Center )
return Infinity.InfinityVector;
if( Infinity.IsInfinite( p ) )
return Center;
Vector3D v = p - Center;
double d = v.Abs();
v.Normalize();
return Center + v * ( Radius * Radius / d );
}
}