from MathNet.Spatial import Euclidean as spa
from MathNet.Spatial import Units as spau
p1 = spa.Point3D(1,1,0)
p2 = spa.Point3D(2,2,0)
p3 = spa.Point3D(2,3,0)
v1 = (p2 - p1).Normalize()
vlen = p1.DistanceTo(p1)
#p1 + vlen*v1 == p2 # True
vx = (p2 - p1).Normalize()
vz = spa.Vector3D(0,0,1).Normalize()
vy = vx.CrossProduct(vz)
ocs = spa.CoordinateSystem(p1,vx,vy,vz)
print("p1 in its own system=%s" % p1.TransformBy(ocs).ToString())
# should give (0,0,0), returns (2.41421356237309, 1, 0)