.| Autor | Beitrag |
|---|---|
|
000 16.11.2002, 17:02 ScyTheMan Moderator |
Hi http://choerbaert.org
Dieser Beitrag wurde am 16.11.2002 um 17:05 von - [ ScyTheMan ] - bearbeitet. |
|
Profil || Suche |
|
001 16.11.2002, 22:15 Kriz |
atan, atan2 double atan( double x ); double atan2( double y, double x ); Routine Required Header Compatibility For additional compatibility information, see Compatibility in the Introduction. Libraries LIBC.LIB Single thread static library, retail version Return Value atan returns the arctangent of x. atan2 returns the arctangent of y/x. If x is 0, atan returns 0. If both parameters of atan2 are 0, the function returns 0. You can modify error handling by using the _matherr routine. atan returns a value in the range –ð/2 to ð/2 radians; atan2 returns a value in the range –ð to ð radians, using the signs of both parameters to determine the quadrant of the return value. Parameters x, y Any numbers Remarks The atan function calculates the arctangent of x. atan2 calculates the arctangent of y/x. atan2 is well defined for every point other than the origin, even if x equals 0 and y does not equal 0. Example /* ATAN.C: This program calculates #include <math.h> void main( void ) printf( "Enter a real number: " ); Output Enter a real number: -862.42 K:R-I)Z++ |
|
Profil || Suche |
|
002 16.11.2002, 22:44 Leviathan |
@kriz: da gehören aber quote-tags drum... @problem: arcustanges bekommt als argument einen bruch, keinen winkel. die rückgabe ist ein winkel, und zwar in der einheit radiant. du nimmt aber die umrechnung von altgrad in radiant am argument des arcustangens vor, du rechnest also einen bruch (genauer: den quotienten aus den beiden katheten) von altgrad in radiant um, obwohl er einheitenlos ist.
kq kannste dir aber sparen wenn du atan2 verwendest (unnütz, dafür einen neuen bezeichner einzuführen, ich hätte ja arc einfach überladen...):
der arcustangens ist aber auch über den arcussinus berechenbar:
Entities: HL | HL² |
|
Profil || Suche |
|
003 16.11.2002, 22:51 ScyTheMan Moderator |
big thx an beide! --http://choerbaert.org
|
|
Profil || Suche |

