This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getAngleFromHorizontal

Return angle between Distance tool and horizontal axis

getAngleFromHorizontal is not recommended. Use one of the ROI classes instead, described in ROI Creation Overview.

Syntax

angle = getAngleFromHorizontal(h)

Description

angle = getAngleFromHorizontal(h) returns the angle, in degrees, between the line defined by the Distance tool, h, and the horizontal axis.

Input Arguments

collapse all

Distance tool, specified as an imdistline object.

Output Arguments

collapse all

Angle, returned as a numeric scalar in the range [0, 180] degrees.

Data Types: double

Algorithms

To understand how imdistline calculates the angle returned by getAngleToHorizontal, draw an imaginary horizontal vector from the bottom endpoint of the distance line, extending to the right. The value returned by getAngleToHorizontal is the angle from this horizontal vector to the distance line, which can range from 0 to 180 degrees.

See Also

Introduced before R2006a