Search code examples
pythonmathdirectionfreecad

How can I get Tangential direction Vector in Python?


I can get some info from a Arc.

  • FirstPoint   [x, y, z]
  • LastPoint   [x, y, z]
  • Center    [x, y, z]
  • Axis      [x, y, z] # Perpendicular to the plane

How can I get the FirstPoint&LastPoint's tangential direction Vector?

I want to get a intersection Point from two direction vector.

I work in FreeCAD.


Solution

  • Circular arc from A to B with center M and normal vector N.

    The tangent directions can be obtained by the cross product.

    • Tangent at A: N x (A-M)
    • Tangent at B: (B-M) x N

    Both correspond to a rotation of 90DEG or -90DEG of the radius vectors around the axis N