Convert Cartesian coordinates to homogeneous coordinates
hom = cart2hom(cart)
example
hom = cart2hom(cart) converts a set of points in Cartesian coordinates to homogeneous coordinates.
hom
cart
collapse all
c = [0.8147 0.1270 0.6324; 0.9058 0.9134 0.0975]; h = cart2hom(c)
h = 2×4 0.8147 0.1270 0.6324 1.0000 0.9058 0.9134 0.0975 1.0000
Cartesian coordinates, specified as an n-by-(k–1) matrix, containing n points. Each row of cart represents a point in (k–1)-dimensional space. k must be greater than or equal to 2.
Example: [0.8147 0.1270 0.6324; 0.9058 0.9134 0.0975]
[0.8147 0.1270 0.6324; 0.9058 0.9134 0.0975]
Homogeneous points, returned as an n-by-k matrix, containing n points. k must be greater than or equal to 2.
Example: [0.2785 0.9575 0.1576 0.5; 0.5469 0.9649 0.9706 0.5]
[0.2785 0.9575 0.1576 0.5; 0.5469 0.9649 0.9706 0.5]
hom2cart
You have a modified version of this example. Do you want to open this example with your edits?