So have you gotten things drawing without the trig functions yet?
Do that first.
WinDrawLine is defined like this:
void WinDrawLine (Coord x1, Coord y1, Coord x2,Coord y2);
not
void WinDrawLine(CharPtr something);

Have you gotten MathLib working yet?
Just a note, according to my Windows 2000 calculator, sin(4) in degrees is:
0.069756473744125300775958835194143.
And in PalmTypes.h there is this definition:
typedef Int16                           Coord;          // screen/window coordinate
which means that if you try putting a float/double in for a Coord(Int16)
parameter your data is going to be hosed.  The standard coordinate system on
the Palm defines a 1:1 correspondance between coordinates and pixels (on a
single-density), what is .069 of a pixel?

Also, sine is a function of time and a sine wave is a graphical depiction of
the values over a time range.  In other words, to get the wave you need to
be inputing a collection of time (x) values to recieve your y values.  This
will give you a collection of (x,y) coordinates that you can graph.
So the single statement y=sin(x) wont give you much of a wave. (Sorry if
this isn't news to you)

Good luck,
Mike

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Al
> Smith
> Sent: Thursday, August 29, 2002 9:31 AM
> To: Palm Developer Forum
> Subject: Help Displaying a Graph!
>
>
>
> I am trying to display a Trig function.does anyone know what
> would be the
> API call to draw lets say the Sine wave.I am fairly new to
> this, this is
> what I thought of so far..
>
> RectangleType r;
>     FormPtr frm;
>     double       x = 4.0;
>     CharPtr    y;
>
>
> y = sin(x);
>       FrmGetObjectBounds(frm, FrmGetObjectIndex(frm,
> WaveSineGadget),&r);
>       WinEraseRectangle(&r, 0);
>       WinDrawRectangleFrame(simpleFrame, &r);
>          WinDrawLine(y);
>
> _________________________________________________________________
> Join the world�s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/support/forums/
>


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to