This site is no longer active and is available for archival purposes only. Registration and login is disabled.

spiral


spiral

Postby laurnet » Apr 27, 2002 @ 1:30pm

User avatar
laurnet
pm Member
 
Posts: 36
Joined: Jan 6, 2002 @ 9:25am
Location: FRANCE


Postby billcow » Apr 27, 2002 @ 3:52pm

Try

This algorithm is for a circle routine, but if I understand it correctly, it should be able to produces ellipses or spirals with few modifications.

BTW, his site has a couple other interesting articles (written with RiscOS machines in mind, but since they use ARM processors even the assembly stuff could be useful).
Most people don't know that "A highly technical term" is actually a highly technical term used to describe something that doesn't mean anything
User avatar
billcow
pm Member
 
Posts: 81
Joined: Jan 6, 2002 @ 12:22am
Location: Dryden, NY


perfect circle

Postby laurnet » Apr 27, 2002 @ 5:07pm

User avatar
laurnet
pm Member
 
Posts: 36
Joined: Jan 6, 2002 @ 9:25am
Location: FRANCE


Postby billcow » Apr 27, 2002 @ 10:55pm

Most people don't know that "A highly technical term" is actually a highly technical term used to describe something that doesn't mean anything
User avatar
billcow
pm Member
 
Posts: 81
Joined: Jan 6, 2002 @ 12:22am
Location: Dryden, NY


circle

Postby laurnet » Apr 29, 2002 @ 12:59am

User avatar
laurnet
pm Member
 
Posts: 36
Joined: Jan 6, 2002 @ 9:25am
Location: FRANCE


Postby Lewil » Apr 29, 2002 @ 5:06pm

User avatar
Lewil
pm Member
 
Posts: 108
Joined: Apr 25, 2002 @ 1:39pm


Postby Lewil » Apr 29, 2002 @ 5:45pm

User avatar
Lewil
pm Member
 
Posts: 108
Joined: Apr 25, 2002 @ 1:39pm


Postby billcow » Apr 29, 2002 @ 6:55pm

The +0.5 is a rounding thing. Because of the way the ISO standard for floating point describes rounding, if you round to an int, it will always round down. If you add 0.5, anything that would round up using "real" rounding will end up with one added to the integer part, and the operation will occur correctly.

An interesting side note, this is the only function (round-to-int) that ISO says should round down. This causes problems on an x86 processor, because the compiler generates code that tells the FPU to change rounding modes, and as a result, it completely screws with the pipeline. The only way around this is to write an inline assembly function that rounds without setting the rounding mode.

I think the rounding issue occurs with int-to-float too.
Most people don't know that "A highly technical term" is actually a highly technical term used to describe something that doesn't mean anything
User avatar
billcow
pm Member
 
Posts: 81
Joined: Jan 6, 2002 @ 12:22am
Location: Dryden, NY


Postby Lewil » Apr 30, 2002 @ 10:36am

User avatar
Lewil
pm Member
 
Posts: 108
Joined: Apr 25, 2002 @ 1:39pm


Postby refractor » Apr 30, 2002 @ 11:13am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


spi

Postby laurnet » May 2, 2002 @ 10:41pm

User avatar
laurnet
pm Member
 
Posts: 36
Joined: Jan 6, 2002 @ 9:25am
Location: FRANCE


Postby Lewil » May 3, 2002 @ 9:12am

if you look closer, you will see that cos and sin are precalculated, and in FP if you please :roll:
User avatar
Lewil
pm Member
 
Posts: 108
Joined: Apr 25, 2002 @ 1:39pm


Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron