Frame.local_to_local_coordinates

static Frame.local_to_local_coordinates(frame1, frame2, object_in_frame1)[source]

Returns the object’s coordinates in frame1 in the local coordinates of frame2.

Parameters
  • frame1 ([point, vector, vector] | compas.geometry.Frame) – A frame representing one local coordinate system.

  • frame2 ([point, vector, vector] | compas.geometry.Frame) – A frame representing another local coordinate system.

  • object_in_frame1 ([float, float, float] | compas.geometry.Geometry) – An object in the coordinate frame1. If you pass a list of float, it is assumed to represent a point.

Returns

compas.geometry.Geometry – The object in the local coordinate system of frame2.

Examples

>>> from compas.geometry import Point
>>> frame1 = Frame([1, 1, 1], [0.68, 0.68, 0.27], [-0.67, 0.73, -0.15])
>>> frame2 = Frame([2, 1, 3], [1., 0., 0.], [0., 1., 0.])
>>> p1 = Point(2, 2, 2) # point in frame1
>>> p2 = Frame.local_to_local_coordinates(frame1, frame2, p1) # point in frame2
>>> Frame.local_to_local_coordinates(frame2, frame1, p2)
Point(2.000, 2.000, 2.000)