Geometry

conics.geometry.hnormalized(p)[source]

Projects points from an \(n\)-dimensional space onto \(n-1\)-dimensional one.

Parameters:

p (numpy.ndarray (n, m)) – The \(n\)-dimensional points to be projected stored in \(m\) columns.

Returns:

The projected points.

Return type:

numpy.ndarray (n-1, m)

conics.geometry.homogeneous(p)[source]

Homogenizes \(n\)-dimensional points by appending all ones to the last dimension.

Parameters:

p (numpy.ndarray (n, m)) – The \(n\)-dimensional points to be homogenized stored in \(m\) columns.

Returns:

The homogenized points.

Return type:

numpy.ndarray (n+1, m)

conics.geometry.line_intersection(l1, l2)[source]

Computes the intersection between two homogeneous lines.

Parameters:
  • l1 (array_like (3, )) – The first line.

  • l2 (array_like (3, )) – The second line.

Returns:

The homogeneous intersection point.

Return type:

numpy.ndarray

conics.geometry.line_through(a, b)[source]

Constructs a homogeneous lines from 2-D points.

Parameters:
  • a (array_like (2, )) – The start point of the line segment.

  • b (array_like (2, )) – The end point of the line segment.

Returns:

The homogeneous line that connects a and b.

Return type:

numpy.ndarray

conics.geometry.projectively_unique(p, atol=0.0001)[source]

Determines unique points in the projective space given a set of points.

Parameters:
  • p (array_like (n, m)) – The possibly non-unique but equivalent up to scale set \(d\)-dimensional points stored in \(m\) columns.

  • atol (float) – The absolute comparison tolerance with respect to the norm of the cross-product of each point pair. The corresponding norm must be (close to) zero for points that are equivalent up to scale. The tolerance accounts for the corresponding round-off error.

Returns:

The subset of points that are unique in projective space.

Return type:

numpy.ndarray

conics.geometry.rot2d(alpha)[source]

Constructs a 2-D rotation matrix given a specified angle.

Parameters:

alpha (float) – The rotation angle in the plane, in radians.

Returns:

The 2-D rotation matrix.

Return type:

numpy.ndarray (2, 2)