"Jacques Paris" <[EMAIL PROTECTED]> wrote:
> I just noticed what seems to be a bug with createcircle(). If I do
>
> Dim o as object
> o=createcircle(1,0,10)
> print area(o,"sq km")
> print perimeter(o,"km")
>
> area= 0 and perimeter>0. It seems that if the x or the y (or both) of the
> circle center is =0, this kind of result will occur.
This is odd, as when I typed
dim o as object
set distance units "km"
o=createcircle(1,0,10)
print area (o, "sq km")
print perimeter (o, "km")
in the MapBasic window it printed
313.954 for the area and 62.8214 for the perimeter.
However, when I used "cm" in "set distance units" it printed 0 for the area.
Notice that the area MapInfo pointed for a 10 km circle is somewhat less
than
pi*r^2. If you issue a "Set Coordsys Layout" before creating the circle
MapInfo
prints an area of 313.957 for a 10-kilometer circle and 3.13893e-08
for a 10 cm circle. It prints the same values for a Nonearth coordinate
system,
even if you move the center to (1, 1).
> Whose fault is it? Createcircle() or Area()???
The fault almost certainly lies with Area(). Rounding error plus a greedy
algorithm, no
doubt.
HTH
Spencer
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.