indexing
	description: "Facilities class for EV_FIGURE."
	legal: "See notice at end of class."
	status: "See notice at end of class."
	keywords: "math"
	date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
	revision: "$Revision: 56675 $"

class interface
	EV_MODEL_DOUBLE_MATH

create 
	default_create
			-- Process instances of classes with no creation clause.
			-- (Default: do nothing.)
			-- (from ANY)

feature -- Access

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

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

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

	ceiling (v: REAL_64): REAL_64
			-- Least integral greater than or equal to `v'
			-- (from DOUBLE_MATH)

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

	dabs (v: REAL_64): REAL_64
			-- Absolute of `v'
			-- (from DOUBLE_MATH)

	euler: REAL_64 is 2.7182818284590452354
			-- Logarithm base
			-- (from MATH_CONST)

	exp (x: REAL_64): REAL_64
			-- Exponential of `v'.
			-- (from DOUBLE_MATH)

	floor (v: REAL_64): REAL_64
			-- Greatest integral less than or equal to `v'
			-- (from DOUBLE_MATH)

	generating_type: STRING_8
			-- Name of current object's generating type
			-- (type of which it is a direct instance)
			-- (from ANY)

	generator: STRING_8
			-- Name of current object's generating class
			-- (base class of the type of which it is a direct instance)
			-- (from ANY)

	log (v: REAL_64): REAL_64
			-- Natural logarithm of `v'
			-- (from DOUBLE_MATH)

	log10 (v: REAL_64): REAL_64
			-- Base 10 logarithm of `v'
			-- (from DOUBLE_MATH)

	log_2 (v: REAL_64): REAL_64
			-- Base 2 logarithm of `v'
			-- (from DOUBLE_MATH)

	pi: REAL_64 is 3.14159265358979323846
			-- (from MATH_CONST)

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

	sqrt (v: REAL_64): REAL_64
			-- Square root of `v'
			-- (from DOUBLE_MATH)

	sqrt2: REAL_64 is 1.41421356237309504880
			-- Square root of 2
			-- (from MATH_CONST)

	tangent (v: REAL_64): REAL_64
			-- Trigonometric tangent of radian `v' approximated
			-- in range [-pi/4, +pi/4]
			-- (from DOUBLE_MATH)
	
feature -- Comparison

	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void
			-- or attached to isomorphic object structures?
			-- (from ANY)
		ensure -- from ANY
			shallow_implies_deep: standard_equal (some, other) implies Result
			both_or_none_void: (some = Void) implies (Result = (other = Void))
			same_type: (Result and (some /= Void)) implies some.same_type (other)
			symmetric: Result implies deep_equal (other, some)

	frozen equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached
			-- to objects considered equal?
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

	is_equal (other: like Current): BOOLEAN
			-- Is `other' attached to an object considered
			-- equal to current object?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			symmetric: Result implies other.is_equal (Current)
			consistent: standard_is_equal (other) implies Result

	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached to
			-- field-by-field identical objects of the same type?
			-- Always uses default object comparison criterion.
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

	frozen standard_is_equal (other: like Current): BOOLEAN
			-- Is `other' attached to an object of the same type
			-- as current object, and field-by-field identical to it?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			same_type: Result implies same_type (other)
			symmetric: Result implies other.standard_is_equal (Current)
	
feature -- Status report

	conforms_to (other: ANY): BOOLEAN
			-- Does type of current object conform to type
			-- of `other' (as per Eiffel: The Language, chapter 13)?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void

	same_type (other: ANY): BOOLEAN
			-- Is type of current object identical to type of `other'?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			definition: Result = (conforms_to (other) and other.conforms_to (Current))
	
feature -- Duplication

	copy (other: like Current)
			-- Update current object using fields of object attached
			-- to `other', so as to yield equal objects.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)

	frozen deep_copy (other: like Current)
			-- Effect equivalent to that of:
			--		copy (`other' . deep_twin)
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			deep_equal: deep_equal (Current, other)

	frozen deep_twin: like Current
			-- New object structure recursively duplicated from Current.
			-- (from ANY)
		ensure -- from ANY
			deep_equal: deep_equal (Current, Result)

	frozen standard_copy (other: like Current)
			-- Copy every field of `other' onto corresponding field
			-- of current object.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_standard_equal: standard_is_equal (other)

	frozen standard_twin: like Current
			-- New object field-by-field identical to `other'.
			-- Always uses default copying semantics.
			-- (from ANY)
		ensure -- from ANY
			standard_twin_not_void: Result /= Void
			equal: standard_equal (Result, Current)

	frozen twin: like Current
			-- New object equal to `Current'
			-- twin calls copy; to change copying/twining semantics, redefine copy.
			-- (from ANY)
		ensure -- from ANY
			twin_not_void: Result /= Void
			is_equal: Result.is_equal (Current)
	
feature -- Basic operations

	frozen default: like Current
			-- Default value of object's type
			-- (from ANY)

	frozen default_pointer: POINTER
			-- Default value of type `POINTER'
			-- (Avoid the need to write `p'.default for
			-- some `p' of type `POINTER'.)
			-- (from ANY)

	default_rescue
			-- Process exception for routines with no Rescue clause.
			-- (Default: do nothing.)
			-- (from ANY)

	frozen do_nothing
			-- Execute a null action.
			-- (from ANY)
	
feature -- Implementation

	between (n, a, b: REAL_64): BOOLEAN
			-- Is `n' a value between `a' and `b'?

	delta_x (angle: REAL_64; length: REAL_64): REAL_64
			-- Get dx component of line segment with `length' and `angle'.

	delta_y (angle: REAL_64; length: REAL_64): REAL_64
			-- Get dy component of line segment with `length' and `angle'.

	distance (x1, y1, x2, y2: REAL_64): REAL_64
			-- Calculate distance between (`x1', `y1') and (`x2', `y2').

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

	line_angle (x1, y1, x2, y2: REAL_64): REAL_64
			-- Return angle of line from (`x1', `y1') to (`x2', `y2') relative to world.
			-- clockwise. 0.0 is 3 o'clock.

	modulo (a, b: REAL_64): REAL_64
			-- `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: REAL_64): BOOLEAN
			-- Is (`x', `y') inside specified ellipse?
		ensure
			equals_point_on_rotated: Result = point_on_rotated_ellipse (x, y, xc, yc, r1, r2, 0.0)

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

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

	point_on_polygon (x, y: REAL_64; points: SPECIAL [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: REAL_64): BOOLEAN
			-- Is (`x', `y') inside specified box?

	point_on_rotated_ellipse (x, y, xc, yc, r1, r2, angle: REAL_64): BOOLEAN
			-- Is ('x', `y') inside specified ellipse?

	point_on_rotated_ellipse_boundary (x, y, xc, yc, r1, r2, angle, width: REAL_64): BOOLEAN
			-- Is (`x', `y') on specified ellipse border?

	point_on_segment (x, y, x1, y1, x2, y2, width: REAL_64): BOOLEAN
			-- Is (`x', `y') on segment [(`x2', `y2'), (`x1', `y1')] with `width'?
	
feature -- Output

	io: STD_FILES
			-- Handle to standard file setup
			-- (from ANY)

	out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of tagged_out.
			-- (from ANY)

	print (some: ANY)
			-- Write terse external representation of `some'
			-- on standard output.
			-- (from ANY)

	frozen tagged_out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of out.
			-- (from ANY)
	
feature -- Platform

	operating_environment: OPERATING_ENVIRONMENT
			-- Objects available from the operating system
			-- (from ANY)
	
invariant
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

indexing
	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		356 Storke Road, Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class EV_MODEL_DOUBLE_MATH