35.3 SDO_UTIL.BEARING_TILT_FOR_POINTS
Format
SDO_UTIL.BEARING_TILT_FOR_POINTS( start_point IN SDO_GEOMETRY, end_point IN SDO_GEOMETRY, tol IN NUMBER, bearing OUT NUMBER, tilt OUT NUMBER ) RETURN SDO_GEOMETRY;
Description
Computes the bearing and tilt from a start point to an end point.
Parameters
- start_point
-
Starting point geometry object from which to compute the bearing and tilt. The point geometry must be based on a geodetic coordinate system.
- end_point
-
Ending point geometry object to use in computing the bearing and tilt. The point geometry must be based on the same geodetic coordinate system as
start_point
. - tol
-
Tolerance value (see Tolerance).
- bearing
-
Number of radians, measured clockwise from North.
- tilt
-
Number of radians, measured from the normal.
Usage Notes
The input point geometries must be based on the same geodetic coordinate system. If they are based on a non-geodetic coordinate system, the output bearing is a null value.
The tilt is computed as the arctangent of the difference between the height values divided by the distance between the points (with height excluded from the distance calculation). That is: tilt = atan(height_difference/distance)
To convert radians to decimal degrees or decimal degrees to radians, you can use the SDO_UTIL.CONVERT_UNIT function. To return a point geometry that is at a specified distance and bearing from a start point, you can use the SDO_UTIL.POINT_AT_BEARING function.
Examples
The following example computes the bearing and tilt for two longitude/latitude points, where the elevation of the start point is 0 (zero) and the elevation of the end point is 5000 meters. This example displays the bearing and tilt values in radians.
DECLARE bearing NUMBER; tilt NUMBER; BEGIN SDO_UTIL.BEARING_TILT_FOR_POINTS( SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-71.5, 43, 0), NULL, NULL), -- start_point SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-71, 43.5, 5000), NULL, NULL), -- end_point 0.05, --tolerance bearing, tilt); DBMS_OUTPUT.PUT_LINE('Bearing = ' || bearing); DBMS_OUTPUT.PUT_LINE('Tilt = ' || tilt); END; / Bearing = .628239101930666 Tilt = .0725397288678286910476298724869396973718
The following example is the same as the preceding one, except that it displays the bearing and tilt in decimal degrees instead of radians.
DECLARE bearing NUMBER; tilt NUMBER; BEGIN SDO_UTIL.BEARING_TILT_FOR_POINTS( SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-71.5, 43, 0), NULL, NULL), -- start_point SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-71, 43.5, 5000), NULL, NULL), -- end_point 0.05, --tolerance bearing, tilt); DBMS_OUTPUT.PUT_LINE('Bearing in degrees = ' || bearing * 180 / 3.1415926535897932384626433832795); DBMS_OUTPUT.PUT_LINE('Tilt in degrees = ' || tilt * 180 / 3.1415926535897932384626433832795); END; / Bearing in degrees = 35.99544906571628894295547577999851892359 Tilt in degrees = 4.15622031114988533540349823511872120415
Related Topics
Parent topic: SDO_UTIL Package (Utility)