| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Maths stuff | |
|---|---|
| Tweet Topic Started: Nov 3 2011, 11:09 AM (214 Views) | |
| DJ-Habana | Nov 3 2011, 11:09 AM Post #1 |
|
C# King
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I am interested in to doing sin cos and tan without a calculator, well the same with power but I figured that one out using the newton method. I am just interested in to coding them haha I know there are build in function but I wanna do it myself too ![]() Where can I learn to do them? without a calculator
|
|
| |
![]() |
|
| Dr. Best | Nov 3 2011, 11:37 AM Post #2 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You can always use the Taylor expansion (see Wikipedia) to get an arbitrarily good approximation. This is quite easy to do and sufficiently efficient. I don't really know how these functions are implemented in the standard library. As far as I know they guarantee exact results except for rounding error. For this reason they probably have some very fancy optimizations and lots of tricks for the best possible performance. |
![]() |
|
| luenardi | Nov 3 2011, 10:37 PM Post #3 |
|
Cofee Machines Rock
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
It's actually clever to build tables instead of having to let the system do more calculations. Instead a variable can popped out of a array without the requirement for extra cpu load. I did this with a 3DRay-caster and it severely saved cpu time just having pre-calculated cos and sin tables. |
![]() For your perception no. But my universe has no such limits. www.recall.co.nr | |
![]() |
|
| Gandalf20000 | Nov 4 2011, 12:33 AM Post #4 |
![]()
Geek
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
If you're using the Taylor series expansion, make sure you use radians, not degrees. You can convert it to degrees afterwards, but you'll get a really weird answer if you don't use radians. Also, if you know a value, you can use the half-angle, double angle, and angle addition and subtraction theorems to find new ones. It's not much use if you're trying to get a computer to calculate it in real-time, but it's useful if you want to build a table. |
![]() |
|
| DJ-Habana | Nov 4 2011, 11:15 AM Post #5 |
|
C# King
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
cool thanx guys I am going to do this !! woohoo might probably not be useful or maybe it would I dunno but it is just something I want to accomplish |
|
| |
![]() |
|
| « Previous Topic · Off-topic · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)






10:20 AM Jul 11