ATan() possible?
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
ATan() possible?
I have come to a snag in my current project which requires an ATan function. I don't think that this can be solved by a simple array of numbers like sin and cos. There 'seems' to be sceFpuSin and sceFpuCos, but I can't see a sceFpuATan function. I couldn't see a function like this in the PSPSDK, and was wondering if somebody can think of a solution to this.
Thanks.
Thanks.
use the math lib ( #include<math.h> and -lm at the link )
see also http://forums.ps2dev.org/viewtopic.php?p=19341#19341
see also http://forums.ps2dev.org/viewtopic.php?p=19341#19341
Code: Select all
Mathematical Library Functions atan(3M)
NAME
atan - arc tangent function
SYNOPSIS
cc [ flag ... ] file ... -lm [ library ... ]
#include <math.h>
double atan(double x);
DESCRIPTION
The atan() function computes the principal value of the arc
tangent of x.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Well, the compiler is finding s_atan.c (newlib/libm/math/s_atan.c), but it gives me lots of undefined referrences to '__adddf3' and '__muldf3'. I have #include <Math.h> and have put -lm for my linker. I think it is also finding the s_atan.o, which has been precompiled. It must be something simple, but i'm not sure what i'm doing wrong.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Something's wrong with your toolchain then. Look if the libgcc.a file is in the toolchain directory. If yes, the toolchain is misplaced, and you need a -L on the command line to specify the path to libgcc.a. If no, your toolchain is fucked up and there's nothing I can do about it.
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Aaaahhh, indeed, I didn't see he was using psp-ld and not psp-gcc...
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Well, the main part of my .sh file looks like this:
Whearas it looked like:When there was the -lgcc not found error.
With the new script, I am getting 'linker input file not used because linking not done'.
I haven't used cygwin and gcc before, so any help will be appreciated, and thanks for being understanding.
Code: Select all
psp-gcc -g -c hellopsp.c
psp-gcc -g -c AnTi2D.c
psp-gcc -g -c -xassembler -O -o startup.o startup.S
psp-gcc -O0 startup.o hellopsp.o AnTi2D.o -lgcc -lm -M -Ttext 8900000 -q -o out > hellopsp.map
Code: Select all
psp-gcc -g -c hellopsp.c
psp-gcc -g -c AnTi2D.c
psp-gcc -g -c -xassembler -O -o startup.o startup.S
psp-ld -O0 startup.o hellopsp.o AnTi2D.o -lgcc -lm -M -Ttext 8900000 -q -o out > hellopsp.map
With the new script, I am getting 'linker input file not used because linking not done'.
I haven't used cygwin and gcc before, so any help will be appreciated, and thanks for being understanding.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am