Main Content

cart2hom

Convert Cartesian coordinates to homogeneous coordinates

Description

example

hom= cart2hom(cart)converts a set of points in Cartesian coordinates to homogeneous coordinates.

Examples

collapse all

c = [0.8147 0.1270 0.6324; 0.9058 0.9134 0.0975]; h = cart2hom(c)
h =2×40.8147 0.1270 0.6324 1.0000 0.9058 0.9134 0.0975 1.0000

Input Arguments

collapse all

Cartesian coordinates, specified as ann-by-(k1)矩阵, containingnpoints. Each row ofcartrepresents a point in (k–1)-dimensional space.kmust be greater than or equal to 2.

Example:[0.8147 0.1270 0.6324; 0.9058 0.9134 0.0975]

Output Arguments

collapse all

Homogeneous points, returned as ann-by-kmatrix, containingnpoints.kmust be greater than or equal to 2.

Example:[0.2785 0.9575 0.1576 0.5; 0.5469 0.9649 0.9706 0.5]

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2015a

See Also