Hesse normal form, also known as normal form or standard form, is a commonly used representation of a straight line in 2-dimensional Euclidean space. It is often used in image processing and computer vision applications.
The Hesse normal form equation for a straight line is expressed as:
main.m36 chars2 lines
where (x,y)
are the coordinates of a point on the line, theta
is the angle between the line and the x-axis, and d
is the signed distance between the line and the origin.
Here's the MATLAB code that converts the Cartesian equation of a straight line to Hesse normal form:
main.m140 chars9 lines
This code assumes that the Cartesian equation is given in the form ax + by + c = 0
. The atan2
function is used to calculate the angle theta
(in radians) between the line and the x-axis, and the sqrt
function is used to normalize the distance d
so that it is the signed distance between the line and the origin.
Note that the Hesse normal form is not unique, as it depends on the choice of the signed distance d
. Different choices of d
can lead to different but equivalent Hesse normal forms.
gistlibby LogSnag