Post: C++ Nth Root and Trig Functions (No Libraries/PS3)
02-24-2016, 08:43 PM #1
gopro_2027
Vault dweller
(adsbygoogle = window.adsbygoogle || []).push({}); I made this using approximations for sin cos tan and finding roots.
The trig functions should run very fast because they don't rely on factorials or anything but the nth root has iterations of 15*(n-1) so it might run a bit slower but is pretty much the best possible.
Pastebin link: You must login or register to view this content.

Cheers!

EDIT: Updated with log2
Last edited by gopro_2027 ; 05-06-2016 at 09:00 PM.

The following 4 users say thank you to gopro_2027 for this useful post:

Krrish Lobbyman, MemoryPointers, modzlife2000, Sloth
02-24-2016, 11:07 PM #2
Mr Smithy x
Former Staff
Originally posted by pro View Post
I made this using approximations for sin cos tan and finding roots.
The trig functions should run very fast because they don't rely on factorials or anything but the nth root has iterations of 15*(n-1) so it might run a bit slower but is pretty much the best possible.
Pastebin link: You must login or register to view this content.
Cheers!


Newtons root algorithm Geo
02-24-2016, 11:08 PM #3
gopro_2027
Vault dweller
Originally posted by Mr
Newtons root algorithm Geo


True True lol I just heard the word "approximate square root" in one of sethbling's videos and I was like THIS IS EXACTLY WHAT I NEED lol

The following user thanked gopro_2027 for this useful post:

Mr Smithy x
05-03-2016, 02:26 AM #4
Originally posted by 2027 View Post
I made this using approximations for sin cos tan and finding roots.
The trig functions should run very fast because they don't rely on factorials or anything but the nth root has iterations of 15*(n-1) so it might run a bit slower but is pretty much the best possible.
Pastebin link: You must login or register to view this content.
Cheers!


Nice work. I did my own version of these a while back aswell :-)
You must login or register to view this content.
This is based on the Taylor Series but it's interesting to see a different approach Happy
Last edited by Joren ; 05-03-2016 at 02:29 AM.
05-04-2016, 03:47 AM #5
gopro_2027
Vault dweller
Originally posted by Joren View Post
Nice work. I did my own version of these a while back aswell :-)
You must login or register to view this content.
This is based on the Taylor Series but it's interesting to see a different approach Happy


Idk if you notices but I used your cos and tan functions xD
05-06-2016, 09:01 PM #6
gopro_2027
Vault dweller
Updated with log2 function

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo