indexing
	description: "Facilities class for EV_FIGURE."
	status: "See notice at end of class"
	keywords: "math"
	date: "$Date$"
	revision: "$Revision$"

class interface
	EV_FIGURE_MATH

feature -- Access

	arc_cosine (v: DOUBLE): DOUBLE
			-- Trigonometric arccosine of radian v
			-- in the range [0, pi]
			-- (from DOUBLE_MATH)

	arc_sine (v: DOUBLE): DOUBLE
			-- Trigonometric arcsine of radian v
			-- in the range [-pi/2, +pi/2]
			-- (from DOUBLE_MATH)

	arc_tangent (v: DOUBLE): DOUBLE
			-- Trigonometric arctangent of radian v
			-- in the range [-pi/2, +pi/2]
			-- (from DOUBLE_MATH)

	ceiling (v: DOUBLE): DOUBLE
			-- Least integral greater than or equal to v
			-- (from DOUBLE_MATH)

	cosine (v: DOUBLE): DOUBLE
			-- Trigonometric cosine of radian v approximated
			-- in the range [-pi/4, +pi/4]
			-- (from DOUBLE_MATH)

	dabs (v: DOUBLE): DOUBLE
			-- Absolute of v
			-- (from DOUBLE_MATH)

	exp (x: DOUBLE): DOUBLE
			-- Exponential of v.
			-- (from DOUBLE_MATH)

	floor (v: DOUBLE): DOUBLE
			-- Greatest integral less than or equal to v
			-- (from DOUBLE_MATH)

	log (v: DOUBLE): DOUBLE
			-- Natural logarithm of v
			-- (from DOUBLE_MATH)

	log10 (v: DOUBLE): DOUBLE
			-- Base 10 logarithm of v
			-- (from DOUBLE_MATH)

	log_2 (v: DOUBLE): DOUBLE
			-- Base 2 logarithm of v
			-- (from DOUBLE_MATH)

	sine (v: DOUBLE): DOUBLE
			-- Trigonometric sine of radian v approximated
			-- in range [-pi/4, +pi/4]
			-- (from DOUBLE_MATH)

	sqrt (v: DOUBLE): DOUBLE
			-- Square root of v
			-- (from DOUBLE_MATH)

	tangent (v: DOUBLE): DOUBLE
			-- Trigonometric tangent of radian v approximated
			-- in range [-pi/4, +pi/4]
			-- (from DOUBLE_MATH)
	
feature -- Implementation

	between (n, a, b: INTEGER): BOOLEAN
			-- Is n a value between a and b?

	delta_x (angle: DOUBLE; length: INTEGER): INTEGER
			-- Get dx component of line segment with length and angle.

	delta_y (angle: DOUBLE; length: INTEGER): INTEGER
			-- Get dy component of line segment with length and angle.

	distance (x1, y1, x2, y2: INTEGER): INTEGER
			-- Calculate distance between (x1, y1) and (x2, y2).

	distance_from_line (x, y, x1, y1, x2, y2: INTEGER): INTEGER
			-- Calculate distance between (x, y) and (x1, y1)-(x2, y2).
			-- The line is considered to be infinite.

	line_angle (x1, y1, x2, y2: INTEGER): DOUBLE
			-- Return angle of line from (x2, y2) to (x1, y1).

	modulo (a, b: DOUBLE): DOUBLE
			-- a modulo b.
		require
			divisible: b /= 0.0
		ensure
			in_interval: Result >= 0.0 and Result < b

	point_on_ellipse (x, y, xc, yc, r1, r2: INTEGER): BOOLEAN
			-- Is (x, y) inside specified ellipse?

	point_on_ellipse_boundary (x, y, xc, yc, r1, r2, width: INTEGER): BOOLEAN
			-- Is (x, y) on specified ellipse border?

	point_on_line (x, y, x1, y1, x2, y2, width: INTEGER): BOOLEAN
			-- Is (x, y) on line from (x2, y2) to (x1, y1) with width?

	point_on_polygon (x, y: INTEGER; points: ARRAY [EV_COORDINATE]): BOOLEAN
			-- Is (x, y) contained in polygon with points?
			-- Based on code by Hanpeter van Vliet.

	point_on_rectangle (x, y, x1, y1, x2, y2: INTEGER): BOOLEAN
			-- Is (x, y) inside specified box?

	point_on_segment (x, y, x1, y1, x2, y2, width: INTEGER): BOOLEAN
			-- Is (x, y) on segment [(x2, y2), (x1, y1)] with width?
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class EV_FIGURE_MATH