Skip to main content


Still trying to figure out how to atan2 in assembly for #LoveByteTCC. Translated some c64 routines that gets me close, but still ways away.
in reply to Devine Lu Linvega

doing this with 16-bit integers seems like a very difficult problem

that said, it's also a very very cool thing

you could apply the same function for reading a joystick signal for example

or create little boids with steering behavious that fly around

atan2 is very cool
in reply to Devine Lu Linvega

It's too hard for me, I've never been good with trigonometry and this one is kicking my butt. I'll wait for tomorrow's #LoveByteTCC puzzle.
in reply to Devine Lu Linvega

trif is the reason I didn't get the grade in calculus I needed (a C-) during school and I had to take it three times
in reply to Philip Nelson

@blu3r4d0n the only time I had geometry classes was in high school and I wasn't paying attention 🤦‍♀️
in reply to Devine Lu Linvega

as much as i admire your ability to make cool stuff i have an even greater respect for your ability to openly and publicly admit your limitations. 🫡
in reply to Devine Lu Linvega

it looked like a stereo picture and I even tried to squint my eyes, but nothing showed🙂
in reply to Devine Lu Linvega

atan2 in (6502) assembly is tricky . x*constant / y can sort of approximates it a bit (it is used in the smaller sized variants of today's challenge)
in reply to Marquee Design

@marqueedesign I went for something like this:

https://raw.githubusercontent.com/dustmop/arctan24/master/arctan.asm

where the screen is divided in 24 segments using bit shifting to find each segment of a quadrant, I could divide in much finer details (16 segments per quadrant). And I managed to draw something like each quadrant, but then I need to find the distance and.. honestly the code is so gross already that I might as well do something else-
in reply to Devine Lu Linvega

Ouch, your environment is giving you a hard time! If you are willing to cheat: math.atan(y/x) is "approximately" the same as y/x (sizecoding trick courtesy of Pestis) . Of course it isn't a great approximation, but you'll end up with something looking like this:
in reply to Devine Lu Linvega

More pointers from the pros:

"instead of r² = x² + y² leaving out the square root also works -> r = x² + y² when done well, the difference is almost not noticeable" - Hellmood

"atan2 is tricky to simulate... trust me i tried" - Superogue
in reply to Lovebyte Demoparty

@lovebyteparty you might have given me a bit of a hint, lemme try this once more.

back to the drawing board
in reply to Devine Lu Linvega

@lovebyteparty I think that if I can test the distance against a sin table, then I should have something that looks like perspective! Thanks for the help with this ^__^
in reply to Devine Lu Linvega

Hopeing it helps to know that everyone agrees that what you are trying to do is -hard-, anything you manage to pull off is cool! 💪

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.