Talk:Trigonometry Functions

Active discussions

Creating a Trig CategoryEdit

I'd love someone forever if they switched this article to a category and made a separate article for each of these. Not too much work, but I'm conversioned out right now...--DragoonWraith 21:58, 9 May 2006 (EDT)

The Stage Function thingEdit

Completely replacing all trig functions with the stage function version seems to be a little extreme. Stage Functions are a good thing, but not everyone might want to use them. Furthermore the non-stage-functions might be a little easier to read. I think it would be best to leave the Trigonometry thread with non-stage functions and add those as an option instead. Yes, thats very redundant, but some people might feel patronised otherwise... and there is nothing we need less than anger on this wiki. :) It'd be good to hear the opinion of others about this. --JustTim 12:06, 10 May 2006 (EDT)

I agree, there is already a Stage_function_repository and we don't need two of them. The advantage of the script snipplets we had here originally was that you could easily copy/paste them into your script and do some tweaks. Stage functions are only useful when they are in one ESM which needs to be installed to use the mod. But even when such an math.esm is established on a broad user base, some modders might prefer a quick solution within their own script when they just need a sine or a square root.--JOG 12:23, 10 May 2006 (EDT)

Removed SectionsEdit

I see no reason for three versions of the Taylor series, and this one is, to me, the most difficult to read. If it has merit, re-add it to the main article, though it must be formatted for being a Stage Function.--DragoonWraith 20:35, 9 May 2006 (EDT)

Really there should just be one set. Kind of pointless to have multiple polynomial approximations of the same order. Note that while many series converge to the desired value, they may not converge very rapidly. Standard approximations (such as from the Handbook of Mathemetical Functions) should probably be used for all functions -- along with pointers back to source text to allow double checking. (I just had to fix the erroneous Galsiah version.) --Wrye 21:11, 7 May 2007 (EDT)

Taylor Series Variant 3Edit

The idea here is to approximate sin(z) and cos(z) with taylor. Since taylor works best with values close to 0, I think it's a good idea to use sin and cos periodicity as many times as possible. then I used taylor to approximate the functions. (Scripts by bifmadeinsabbioni)

ScriptName Sin(Z)
set Angolo to AngleZ ; Angolo is the angle of which we want to calculate the sin
set Sign to 1 ; it's the sign adjustment of the result 

if (Angolo < 0) ; sin(-z) = -sin(z) 
       set Angolo to Angolo * (-1)
       set Sign to Sign * (-1)
endif

if (Angolo > 180)&& (Angolo <=360) ; if 180<=z<=360 sin(z) = -sin(z-180)
	set Sign to Sign * (-1)
	set Angolo to (Angolo - 180)
endif
 
if (Angolo > 90)&&(Angolo <=180) ; if 90<=z<=180 sin (z) = sin (180-z)
	set Angolo to (180 - angolo)
endif

if (Angolo >45)&&(Angolo <=90) ; if 45<z<90 sin(z) = cos(90-z)
	set Angle to (90 - Angolo)
     	set Angle to (3.14159265 * Angle / 180) ;now in radiants
	set X2 to Angle * Angle
	set X4 to X2 * X2
	set X6 to X4 * X2
	set X8 to X4 * X4
	set SinZ to (1 - X2 / 2 + X4 / 24 - X6 / 720 + X8 / 40320)
	set SinZ to SinZ*Sign
endif

if (Angolo>=0)&&(Angolo<=45)
	set Angle to Angolo
     	set Angle to (3.14159265 * Angle / 180) ;now in radiants
	set X to Angle
	set X3 to X*X*X
	set X5 to X3*X*X
	set X7 to X3*X3*X
	set X9 to X3*X3*X3
	set SinZ to (X - X3 / 6 + X5 / 120 - X7 / 5040 + X9 / 362880)
	set SinZ to SinZ*Sign
endif
ScriptName Cos(Z)
set Angolo to AngleZ ; Angolo is the angle of which we want to calculate the cos
set Sign to 1 ; it's the sign adjustment of the result 
 
if (Angolo < 0) ; cos(-z) = cos(z) 
       set Angolo to Angolo * (-1)
endif

if (Angolo > 180)&& (Angolo <=360) ; if 180<=z<=360 cos(z) = -cos(z-180)
	set Sign to Sign * (-1)
	set Angolo to (Angolo - 180)
endif

if (Angolo > 90)&&(Angolo <=180)   ; if 90<=z<=180 cos (z) = -cos(180-z)
	set Angolo to (180 - Angolo)
	set Sign to Sign * (-1)
endif

if (Angolo >45)&&(Angolo <=90) if 45<z<90 cos(z) = sin(90-z)
	set Angle to (90 - Angolo)
     	set Angle to (3.14159265 * Angle / 180) ;now in radiants
	set X to Angle
	set X3 to X*X*X
	set X5 to X3*X*X
	set X7 to X3*X3*X
	set X9 to X3*X3*X3
	set CosZ to (X - X3 / 6 + X5 / 120 - X7 / 5040 + X9 / 362880)
	set CosZ to CosZ * Sign
endif

if (Angolo>=0)&&(Angolo<=45)
	set Angle to Angolo
     	set Angle to (3.14159265 * Angle / 180) ;now in radiants
	set X2 to Angle * Angle
	set X4 to X2 * X2
	set X6 to X4 * X2
	set X8 to X4 * X4
	set CosZ to (1 - X2 / 2 + X4 / 24 - X6 / 720 + X8 / 40320)
	set CosZ to CosZ * Sign
endif
Return to "Trigonometry Functions" page.