2 #ifndef vgl_homg_operators_2d_h_ 3 #define vgl_homg_operators_2d_h_ 25 # include <vcl_msvc_warnings.h> 27 #include <vnl/vnl_fwd.h> 77 if (d <= 0)
return false;
218 #define VGL_HOMG_OPERATORS_2D_INSTANTIATE(T) \ 219 "Please #include <vgl/algo/vgl_homg_operators_2d.hxx>" 221 #endif // vgl_homg_operators_2d_h_ static vgl_conic< T > vgl_conic_from_matrix(vnl_matrix_fixed< T, 3, 3 > const &mat)
returns the vgl_conic which has the given matrix as its matrix.
static vgl_homg_point_2d< T > conjugate(const vgl_homg_point_2d< T > &a, const vgl_homg_point_2d< T > &b, const vgl_homg_point_2d< T > &c, double cr=-1.0)
Conjugate point of three given collinear points.
static vnl_matrix_fixed< T, 3, 3 > matrix_from_conic(vgl_conic< T > const &)
returns 3x3 matrix containing conic coefficients.
Represents a homogeneous 2D line.
static vgl_homg_point_2d< T > intersection(const vgl_homg_line_2d< T > &line1, const vgl_homg_line_2d< T > &line2)
Get the intersection point of two lines (the cross-product).
static vgl_homg_line_2d< T > perp_line_through_point(const vgl_homg_line_2d< T > &line, const vgl_homg_point_2d< T > &point)
Get the perpendicular line to line which passes through point.
static std::list< vgl_homg_point_2d< T > > do_intersect(vgl_conic< T > const &q, vgl_homg_line_2d< T > const &l)
This function is called from within intersection(vgl_conic<T>,vgl_homg_line_2d<T>).
static vgl_homg_point_2d< T > midpoint(const vgl_homg_point_2d< T > &p1, const vgl_homg_point_2d< T > &p2)
Return the midpoint of the line joining two homogeneous points.
static vgl_homg_point_2d< T > closest_point(vgl_homg_line_2d< T > const &l, vgl_homg_point_2d< T > const &p)
Return the point on the line closest to the given point.
static vnl_vector_fixed< T, 3 > most_orthogonal_vector(const std::vector< vgl_homg_line_2d< T > > &lines)
compute most orthogonal vector with vnl_symmetric_eigensystem.
static vnl_vector_fixed< T, 3 > get_vector(vgl_homg_point_2d< T > const &p)
get a vnl_vector_fixed representation of a homogeneous object.
2D homogeneous operations.
static vgl_homg_line_2d< T > join(const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
Get the line through two points (the cross-product).
static void unitize(vgl_homg_point_2d< T > &a)
Normalize vgl_homg_point_2d<T> to unit magnitude.
static vgl_homg_point_2d< T > lines_to_point(const std::vector< vgl_homg_line_2d< T > > &lines)
Intersect a set of 2D lines to find the least-square point of intersection.
static double cross_ratio(const vgl_homg_point_2d< T > &p1, const vgl_homg_point_2d< T > &p2, const vgl_homg_point_2d< T > &p3, const vgl_homg_point_2d< T > &p4)
cross ratio of four collinear points.
static T perp_dist_squared(const vgl_homg_line_2d< T > &line, const vgl_homg_point_2d< T > &point)
static vgl_homg_line_2d< T > join_oriented(const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
Get the line through two points (the cross-product).
static vnl_matrix_fixed< T, 3, 3 > matrix_from_dual_conic(vgl_conic< T > const &)
returns 3x3 matrix containing conic coefficients of dual conic.
static vgl_homg_point_2d< T > perp_projection(const vgl_homg_line_2d< T > &line, const vgl_homg_point_2d< T > &point)
Get the perpendicular projection of point onto line.
static T distance_squared(vgl_conic< T > const &c, vgl_homg_point_2d< T > const &p)
Return the shortest squared distance between the conic and the point.
static vnl_vector_fixed< T, 3 > most_orthogonal_vector_svd(const std::vector< vgl_homg_line_2d< T > > &lines)
compute most orthogonal vector with SVD.
static T distance_squared(const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
Get the square of the 2D distance between the two points.
vgl_homg_point_1d< T > operator *(vnl_matrix_fixed< T, 2, 2 > const &m, vgl_homg_point_1d< T > const &p)
Transform a point through a 2x2 projective transformation matrix.
static vgl_box_2d< T > compute_bounding_box(vgl_conic< T > const &c)
Compute the bounding box of an ellipse.
static double angle_between_oriented_lines(const vgl_homg_line_2d< T > &line1, const vgl_homg_line_2d< T > &line2)
Get the angle between two lines, a number between -PI and PI.
static T distance(const vgl_homg_point_2d< T > &point1, const vgl_homg_point_2d< T > &point2)
Get the 2D distance between the two points.
static double line_angle(const vgl_homg_line_2d< T > &line)
Get the anticlockwise angle between a line and the x axis.
static double abs_angle(const vgl_homg_line_2d< T > &line1, const vgl_homg_line_2d< T > &line2)
Get the 0 to pi/2 angle between two lines.
Represents a homogeneous 2D point.
static std::list< vgl_homg_line_2d< T > > common_tangents(vgl_conic< T > const &c1, vgl_conic< T > const &c2)
Return the list of common tangent lines of two conics.
static T perp_dist_squared(const vgl_homg_point_2d< T > &point, const vgl_homg_line_2d< T > &line)
Get the square of the perpendicular distance to a line.
static bool is_within_distance(const vgl_homg_point_2d< T > &p1, const vgl_homg_point_2d< T > &p2, double d)
True if the points are closer than Euclidean distance d.
static std::list< vgl_homg_line_2d< T > > tangent_from(vgl_conic< T > const &c, vgl_homg_point_2d< T > const &p)
Return the (at most) two tangent lines that pass through p and are tangent to the conic.