Mail Archives: djgpp/1999/03/14/20:30:37
Message-ID: | <36EBFD7D.7D0FCB2C@geocities.com>
|
From: | The Beyonder <beyonder69 AT geocities DOT com>
|
X-Mailer: | Mozilla 4.51 [en] (Win95; I)
|
X-Accept-Language: | en
|
MIME-Version: | 1.0
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | sin(acos((float)i/1024))*0x10000L
|
Lines: | 40
|
Date: | Sun, 14 Mar 1999 13:18:37 -0500
|
NNTP-Posting-Host: | 209.103.48.179
|
X-Complaints-To: | abuse AT sprint DOT ca
|
X-Trace: | newscontent-02.sprint.ca 921435408 209.103.48.179 (Sun, 14 Mar 1999 13:16:48 EDT)
|
NNTP-Posting-Date: | Sun, 14 Mar 1999 13:16:48 EDT
|
Organization: | Sprint Canada Inc.
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi Y'all,
after visiting a site on how to draw primitive shapes to the screen, I
decided to try this circle technique. It said to first generate a
trigonomitry table full of sin_acos info? So I copied his source code:
<BEGIN SOURCE CODE>
long table[1024];
printf( "Generating Trigonomitry table..." );
fflush( stdout ); // So that it writes it to the screen
for (int i=0;i<1024;i++) {
table[i]=sin(acos((float)i/1024))*0x10000L;
// Whats this part for?
}
printf( "Done\n" );
</END SOURCE CODE>
the tutorial said that he's using fixed point math, instead of floating
point for faster circles.
After compilation, I get 1 warning: cast from 'long int' to 'double'.
I ignore this...
Now during compilation it just gets stuck on "Generating Tri table...".
SIN alone works, and so does COS... but ACOS alone just stalls (I can
quit using CTRL-C).
Is it ACOS or my programming?
NOTE: my computer does not have an FPU unit, but I waited for the thing
for nearly 10 MINS, and it still didn't do anything...
--
**********************************************************************
* Sahab Yazdani * In wars, fools kill fools for foolish *
* Thornhill Secondary School * reasons - Thom Merrilin (WoT) *
**********************************************************************
* http://www.geocities.com/TimesSquare/Bunker/8994/index.html * Y2K? *
* Click the link to visit my portion of The Neverhood * A-OK *
**********************************************************************
- Raw text -