Transform GetTransformToZ( XYZ v )
{
Transform t;
double a = XYZ.BasisZ.AngleTo( v );
if( Util.IsZero( a ) )
{
t = Transform.Identity;
}
else
{
XYZ axis = Util.IsEqual( a, Math.PI )
? XYZ.BasisX
: v.CrossProduct( XYZ.BasisZ );
//t = Transform.get_Rotation( XYZ.Zero, axis, a ); // 2013
t = Transform.CreateRotation( axis, a ); // 2014
}
return t;
}