주요 콘텐츠

transformPoint

R2026b

Class: simscape.multibody.Transformation
Namespace: simscape.multibody

Transform 3-D column vectors

Since R2022a

Description

xp = transformPoint(t,p) applies a transformation to a set of 3-D column vectors that represent point positions. The method applies both the rotational and translational parts of the transformation to compute the new point positions.

If the t argument is a transformation from the follower frame to base frame and the ith column of the p argument represents the position vector of a point resolved in the follower frame, the ith column of the xp argument represents the same point resolved in the base frame.

example

Input Arguments

expand all

Transformation, specified as a simscape.multibody.Transformation object.

Coordinates of the points, specified as a simscape.Value object that represents one or more 3-D column vectors with units of length.

Output Arguments

expand all

Coordinates of the transformed points, returned as a simscape.Value object that represents one or more 3-D column vectors with units of length. The returned vectors and the vectors specified for the p argument have the same size and units.

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Examples

expand all

This example shows how to use transformPoint to apply both rotation and translation to a point.

Create a transformation that rotates 90 degrees about the z-axis and translates 5 meters along the x-axis.

t = simscape.multibody.Transformation([0.7071 0 0 0.7071], simscape.Value([5; 0; 0],"m"))
t =
  Transformation:

       Rotation: [0.7071 0 0 0.7071]
    Translation: [5 0 0] (m)

Transform a point at [1; 0; 0] meters. The method first rotates the point 90 degrees about the z-axis to [0; 1; 0], then translates the result by [5; 0; 0] meters.

xp = transformPoint(t, simscape.Value([1; 0; 0],"m"))
xp =
    5.0000
    1.0000
         0

    (m)

Compare with transformDirection, which applies only the rotation and ignores the translation. This is because directions represent orientations, not positions in space.

xv = transformDirection(t, [1; 0; 0])
xv = 3×1 double
    0.0000
    1.0000
         0

Version History

Introduced in R2022a