f(x)
is graphed below.
What is f(x)
?
f(x)=
VSCALE
FN
(
1 / HSCALEx)
The function starts at its maximum value (ie, f(0)=VSCALE
), so what kind of function is it?
The cosine function, \cos(x)
, starts at 1 (ie, \cos(0)=1
), so f(x)
must be a scaled version of the cosine function.
The function starts at zero (ie, f(0)=0
), so what kind of function is it?
The sine function, \sin(x)
, starts at 0 (ie, \sin(0)=0
), so f(x)
must be a scaled version of the sine function.
The distance from peak to peak is piFraction( PERIOD )
, so the period of f(x)
is piFraction( PERIOD )
.
The distance between every other zero is piFraction( PERIOD )
, so the period of f(x)
is piFraction( PERIOD )
.
The period of a normal FNS function is 2\pi
, and the period we want is piFraction( PERIOD )
, so we don't need to worry about scaling the function horizontally.
The period of a normal FNS function is 2\pi
, and the period we want is piFraction( PERIOD )
, so we need to scale the FNS function horizontally by decFrac( PERIOD / 2 / PI )
.
To horizontally scale \FN(x)
by decFrac( PERIOD / 2 / PI )
, we need to substitute decFrac( 2 * PI / PERIOD )x
in for x
to get \FN(decFrac( 2 * PI / PERIOD )x)
.
The height of f(x)
is decFrac( VSCALE )
, so the amplitude of f(x)
is decFrac( VSCALE )
.
The amplitude of f(x)
is 1, so we don't need to worry about scaling the function vertically.
The amplitude of f(x)
is decFrac( VSCALE )
, so we need to scale FNS function vertically by decFrac( VSCALE )
.
To scale the function vertically, multiply the whole thing by decFrac( VSCALE )
.
So the resulting function (after we perform all these manipulations) is plus( toFractionTex( VSCALE ) + "\\" + FN + "(" + plus( toFractionTex( 1 / HSCALE ) + "x" ) + ")" )
.