Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!cc-server4.massey.ac.nz!T.Moore From: T.Moore@massey.ac.nz (T. Moore) Newsgroups: comp.lang.pascal Subject: Re: Needed:Trig Func arccos Message-ID: <1990Nov19.235515.24772@massey.ac.nz> Date: 19 Nov 90 23:55:15 GMT References: <7300@hub.ucsb.edu> <6335@vice.ICO.TEK.COM> Organization: Massey University, Palmerston North, New Zealand Lines: 29 X-Reader: NETNEWS/PC Version 2.2 >Okay peoples. I'm working on a 3-d Rotation program >that uses spherical co-ordinates. Part of it >involves using the arccos function. Unfortunately, >Turbo Pascal doesn't have one. Arccos(x) = PI/2 - Arctan(x /sqrt(1 - x*x)) Arcsin(x) = Arctan(x/sqrt(1-x*x)) All angles returned are, of course, principle angles. Bob Beauchaine This is fine, so long as your picture is not too complicated. Otherwise you will find it incredibly slow. Some people have resorted to assembler for things like this but, even in Pascal, you can speed things up a lot by using a table of sines and cosines. -- Terry Moore Department of Mathematics and Statisics, Massey University, Palmerston North, New Zealand Kroneker: "God made the natural numbers, the rest is the work of man." Zermelo: "But I can construct the natural from the empty set alone." Bystander: "Who said 'You can't get something for nothing.'?"