Loading ...
Sorry, an error occurred while loading the content.

63RE: [cc2-dev-l] Re: XP toolkit: questions about arcs

Expand Messages
  • Bruce A. Carson
    Jul 3 2:09 PM
      Obvious but...Before performing your line calculations you must also assure
      the three points do not lie on a single line or your equations will have an
      infinite number of solutions - all for very "flat" elipses ;^)


      -----Original Message-----
      From: Peter Olsson [mailto:peter@...]
      Sent: Monday, July 03, 2000 11:15 AM
      To: cc2-dev-l@egroups.com
      Subject: [cc2-dev-l] Re: XP toolkit: questions about arcs

      Hi Chris,

      >I'm tackling an XP command involving arcs, and I'm wondering
      >if anyone can answer the following questions:
      >- Is there an easy way to get a point along a specified
      > arc, i.e. is there a function that takes an GARC2
      > structure and a parameter T between 0 and 1, and
      > returns the point corresponding to the given T on the
      > given arc?

      There are several ways to do this. Here is two of them:

      1. Do it yourself.

      GARC2 TheArc;
      float T; // 0 <= T <= 1
      GPOINT2 Pt; // Result

      PConv(TheArc.Circle.Center.x, TheArc.Circle.Center.y, TheArc.Circle.Radius,
      TheArc.SAng+TheArc.AngW*T, &Pt);

      2. Use the T conversion functions.

      GARC2 TheArc;
      float T; // 0 <= T <= 1
      GPOINT2 Pt; // Result
      ARC2 Arc={sizeof(ARC2), ET_ARC2};


      ECalPt2((pENTREC)&Arc, T, &Pt);

      >- How would one utilize the toolkit to go about deriving
      > an arc that fits three given points? I'm trying to
      > do something similar to what the ARCB command does in
      > CC2, and I'm assuming that there is a toolkit function
      > that fits an arc to three given points, but I can't
      > find it.

      There is (to my knowledge) no function that will do all of it for you.
      However by using PConv, Dist2P, Angle and IntL2 you will get ride of the
      trig and only work out the geometry.

      I have define some Ex functions (PConvEx, Dist2PEx etc) that works on
      GPOINT2:s rather than two floats. I don't know if it is included in the
      toolkit distribution or not. If not let me know and I'll send you the files.
      They also include some glue routines not provided in the toolkit.


      Free Worldwide Calling with Firetalk!
      Click Here:

      To Post a message, send it to: cc2-dev-l@...
      To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
    • Show all 4 messages in this topic