Difference between revisions of "InCircle"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <func>function InCircle(x, y, mx, my, r: Integer): Boolean;</func> ==Availability== SCAR Divi 3.00 > Current ==Description== This function determines whether a c...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
<func>function InCircle(x, y, mx, my, r: Integer): Boolean;</func>
+
<source lang="scar" lines="false">
 +
function InCircle(const x, y, mx, my, r: Integer): Boolean;
 +
</source>
  
 
==Availability==
 
==Availability==
Line 6: Line 8:
  
 
==Description==
 
==Description==
This function determines whether a coordinate specified by ('''x''', '''y''') can be found inside or on top of a [http://en.wikipedia.org/wiki/Circle circle] specified by the midpoint ('''mx''', '''my''') and the radius '''r'''. If the coordinate is outside of the [http://en.wikipedia.org/wiki/Circle circle], [[False]] is returned.
+
This function determines whether a coordinate specified by ('''x''', '''y''') can be found inside or on top of a [http://en.wikipedia.org/wiki/Circle circle] specified by the midpoint ('''mx''', '''my''') and the radius '''r'''. If the coordinate is outside of the circle, [[False]] is returned.
  
 
==Example==
 
==Example==

Latest revision as of 22:09, 20 October 2011

Definition

function InCircle(const x, y, mx, my, r: Integer): Boolean;

Availability

SCAR Divi 3.00 > Current

Description

This function determines whether a coordinate specified by (x, y) can be found inside or on top of a circle specified by the midpoint (mx, my) and the radius r. If the coordinate is outside of the circle, False is returned.

Example

begin
  if InCircle(1, 1, 2, 2, 2) then
    WriteLn('The point can be found in or on the circle')
  else
    WriteLn('The point is outside the circle');
end.

Output:

The point can be found in or on the circle

See Also