RE: Hi I'm new

2000-09-21 Thread Xavier Bury

Cartesian equation: x2 + y2 = a2

or parametrically: x = a cos(t), y = a sin(t)

Polar equation: r = a

but the rest is at...

http://www.ussc.alltheweb.com/cgi-bin/search?exec=FAST+Search&type=all&query
=code+pixels+circle+points

even if you can't plot using the pencil tool, you can
estimate the sizes using the circle as a rectangle...

scripting left as an excercise!

Xavier

> > > I've been reading the list heaps and finding out almost all
> > that I need to
> > > know at this stage but I have one big problem.
> > >
> > > I am developing a stack that needs to redraw an ellipse and a
> > circular arc
> > > that intersects with the ellipse at two points. I thought
> that the oval
> > > graphic was the best tool for the job but how do I find the
> > intersection
> > > points. The rect of the arc is set and the user sets the rect of the
> > > ellipse. I really only need to know the x coordinates so I can
> > calculate the
> > > arcAngle and the startAngle of the arc.
> > >
> > > My understanding is that an oval has no real mathematical
> > definition so is
> > > the oval tool actually an ellipse?
>
> a little meta geometry should help here...
> given that im not sure what you mean with elipses and ovals (pretty
> ambiguous here)
> you can do a lot of precise enough calculations with geometry...
> If you draw a rectangle (rect) over that same oval you have an easier view
> to "estimate" your points...
>
> the thing is algebra level, and it's easy to find code (borrowed from c or
> java anywhere on the net... (all the keywords for the search are in that
> previous sentence - will take ya right to it). There's also tons of good
> programming books on this subject! im a little tempted to do some too
> lately... i'll c what I can find!
>
> http://www.mathcom.com/nafaq/q230.8.html
> http://www.mathcom.com/nafaq/q285.html
> and
> http://www.primenet.com/~grieggs/cg_faq.html
>
> draw a circle as a Bezier (or B-spline) curve?
> http://www.primenet.com/~grieggs/cg_faq.html#Howto_Spline
> tell whether a point is within a planar polygon?
> http://www.primenet.com/~grieggs/cg_faq.html#Howto_PIP
>
> in sum without code or more
> there I found...
>
> How do I draw a circle as a Bezier (or B-spline) curve?
> The short answer is, "You can't." Unless you use a rational spline you can
> only approximate a circle. The approximation may look acceptable,
> but it is
> sensitive to scale. Magnify the scale and the error of approximation
> magnifies. Deviations from circularity that were not visible in the small
> can become glaring in the large. If you want to do the job right, consult
> the article:
> "A Menagerie of Rational B-Spline Circles" by Leslie Piegl and
> Wayne Tiller
> in IEEE Computer Graphics and Applications, volume 9, number 9, September,
> 1989, pages 48-56.
> (www.ieee.org or something like that...)
>
> For rough, non-rational approximations, consult the book:
>
> Computational Geometry for Design and Manufacture by I. D. Faux and M. J.
> Pratt, Ellis Horwood Publishers, Halsted Press, John Wiley 1980.
>
> For the best known non-rational approximations, consult the article:
>
> "Good Approximation of Circles by Curvature-continuous Bezier
> Curves" by Tor
> Dokken, Morten Daehlen, Tom Lyche, and Knut Morken in Computer Aided
> Geometric Design, volume 7, numbers 1-4 (combined), June, 1990,
> pages 33-41
> [Elsevier Science Publishers (North-Holland)]
>
>
> How do I tell whether a point is within a planar polygon?
> Consider a ray originating at the point of interest and continuing to
> infinity. If it crosses an odd number of polygon edges along the way, the
> point is within the polygon. If the ray crosses an even number of
> edges, the
> point is either outside the polygon, or within an interior hole
> formed from
> intersecting polygon edges. This idea is known in the trade as the Jordan
> curve theorem; see Eric Haines' article in Glassner's ray tracing book
> (above) for more information, including treatment of special cases.
> Another method is to sum the absolute angles from the point to all the
> vertices on the polygon. If the sum is 2 pi, the point is inside,
> if the sum
> is 0 the point is outside. However, this method is about an order of
> magnitude slower than the previous method because evaluating the
> trigonometric functions is usually quite costly.
>
> www.ddj.com might have some nice algorythms too!!! almost forgot my bible!
>
>
> Archives: http://www.mail-archive.com/metacard%40lists.best.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> Please send bug reports to <[EMAIL PROTECTED]>, not this list.
>


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




RE: Hi I'm new

2000-09-21 Thread Xavier Bury


> > I've been reading the list heaps and finding out almost all
> that I need to
> > know at this stage but I have one big problem.
> >
> > I am developing a stack that needs to redraw an ellipse and a
> circular arc
> > that intersects with the ellipse at two points. I thought that the oval
> > graphic was the best tool for the job but how do I find the
> intersection
> > points. The rect of the arc is set and the user sets the rect of the
> > ellipse. I really only need to know the x coordinates so I can
> calculate the
> > arcAngle and the startAngle of the arc.
> >
> > My understanding is that an oval has no real mathematical
> definition so is
> > the oval tool actually an ellipse?

a little meta geometry should help here...
given that im not sure what you mean with elipses and ovals (pretty
ambiguous here)
you can do a lot of precise enough calculations with geometry...
If you draw a rectangle (rect) over that same oval you have an easier view
to "estimate" your points...

the thing is algebra level, and it's easy to find code (borrowed from c or
java anywhere on the net... (all the keywords for the search are in that
previous sentence - will take ya right to it). There's also tons of good
programming books on this subject! im a little tempted to do some too
lately... i'll c what I can find!

http://www.mathcom.com/nafaq/q230.8.html
http://www.mathcom.com/nafaq/q285.html
and
http://www.primenet.com/~grieggs/cg_faq.html

draw a circle as a Bezier (or B-spline) curve?
http://www.primenet.com/~grieggs/cg_faq.html#Howto_Spline
tell whether a point is within a planar polygon?
http://www.primenet.com/~grieggs/cg_faq.html#Howto_PIP

in sum without code or more
there I found...

How do I draw a circle as a Bezier (or B-spline) curve?
The short answer is, "You can't." Unless you use a rational spline you can
only approximate a circle. The approximation may look acceptable, but it is
sensitive to scale. Magnify the scale and the error of approximation
magnifies. Deviations from circularity that were not visible in the small
can become glaring in the large. If you want to do the job right, consult
the article:
"A Menagerie of Rational B-Spline Circles" by Leslie Piegl and Wayne Tiller
in IEEE Computer Graphics and Applications, volume 9, number 9, September,
1989, pages 48-56.
(www.ieee.org or something like that...)

For rough, non-rational approximations, consult the book:

Computational Geometry for Design and Manufacture by I. D. Faux and M. J.
Pratt, Ellis Horwood Publishers, Halsted Press, John Wiley 1980.

For the best known non-rational approximations, consult the article:

"Good Approximation of Circles by Curvature-continuous Bezier Curves" by Tor
Dokken, Morten Daehlen, Tom Lyche, and Knut Morken in Computer Aided
Geometric Design, volume 7, numbers 1-4 (combined), June, 1990, pages 33-41
[Elsevier Science Publishers (North-Holland)]


How do I tell whether a point is within a planar polygon?
Consider a ray originating at the point of interest and continuing to
infinity. If it crosses an odd number of polygon edges along the way, the
point is within the polygon. If the ray crosses an even number of edges, the
point is either outside the polygon, or within an interior hole formed from
intersecting polygon edges. This idea is known in the trade as the Jordan
curve theorem; see Eric Haines' article in Glassner's ray tracing book
(above) for more information, including treatment of special cases.
Another method is to sum the absolute angles from the point to all the
vertices on the polygon. If the sum is 2 pi, the point is inside, if the sum
is 0 the point is outside. However, this method is about an order of
magnitude slower than the previous method because evaluating the
trigonometric functions is usually quite costly.

www.ddj.com might have some nice algorythms too!!! almost forgot my bible!


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




RE: Hi I'm new

2000-09-21 Thread Scott Raney

On Thu, 21 Sep 2000, Monte Goulding wrote:

> I've been reading the list heaps and finding out almost all that I need to 
> know at this stage but I have one big problem.
> 
> I am developing a stack that needs to redraw an ellipse and a circular arc 
> that intersects with the ellipse at two points. I thought that the oval 
> graphic was the best tool for the job but how do I find the intersection 
> points. The rect of the arc is set and the user sets the rect of the 
> ellipse. I really only need to know the x coordinates so I can calculate the 
> arcAngle and the startAngle of the arc.
> 
> My understanding is that an oval has no real mathematical definition so is 
> the oval tool actually an ellipse?

Yes: Blame the HyperCard developers for this abuse of mathematical
terminology, which we just followed.

> If so can I obtain the submajor and 
> subminor axes of that ellipse?

Given the imprecision associated with drawing ellipses and the
differences in how they're drawn on the different platforms (and
believe me, we've tried long and hard to eliminate or at least
minimize these) IMHO you're probably not going to be able to do what
you want using this style of graphic.  Instead, I recommend using a
polygon object and generating the points of the arcs and ellipses (and
whatever other shapes you need) with scripts.  This way you can be
exactly sure where the points are, and that you have enough of them
to make a smooth shape at any size.  It does require a little math
(high-school geometry), but doing it this way will save you a lot of
time and headache in the long run.

> My other big question was why when we build a standalone there is no 
> facility to set icons for that standalone other than 0(standalone builder 
> custom prop mcappicon). I am planning to modify the standalone builder so 
> that i can set an icon for a custom file type as icon 1(standalone builder 
> custom prop mcdocicon). Is this modification a breach of license or 
> anything? It would be really good If in future versions of MetaCard the 
> engine had a couple more dummy icons in icon 2 & 3 so we could play with 
> these too.

There are two icons in the Win32 engine, one for the app and one for a
document icon.  You can change the first using the standalone builder,
but you'd have to change the second with an icon editor (like
AX-Icons) that can edit icons in place.  I'll submit a feature-request
for a way to change the second one in the standalone builder too.
  Regards,
Scott

> Regards
> Monte Goulding


Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




RE: Hi I'm new

2000-09-20 Thread Monte Goulding

Hi List

I've been reading the list heaps and finding out almost all that I need to 
know at this stage but I have one big problem.

I am developing a stack that needs to redraw an ellipse and a circular arc 
that intersects with the ellipse at two points. I thought that the oval 
graphic was the best tool for the job but how do I find the intersection 
points. The rect of the arc is set and the user sets the rect of the 
ellipse. I really only need to know the x coordinates so I can calculate the 
arcAngle and the startAngle of the arc.

My understanding is that an oval has no real mathematical definition so is 
the oval tool actually an ellipse? If so can I obtain the submajor and 
subminor axes of that ellipse?

My other big question was why when we build a standalone there is no 
facility to set icons for that standalone other than 0(standalone builder 
custom prop mcappicon). I am planning to modify the standalone builder so 
that i can set an icon for a custom file type as icon 1(standalone builder 
custom prop mcdocicon). Is this modification a breach of license or 
anything? It would be really good If in future versions of MetaCard the 
engine had a couple more dummy icons in icon 2 & 3 so we could play with 
these too.

Regards
Monte Goulding
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.