Hello Everyone,
I'm having some problems with a bit of trig based maths code I'm am trying to write for a game, The problem is this:
I have an object that is moving in 2d space along the y-axis using a sin wave function.
At any time, given the current amplitude and frequency, I want to be able to get the degree/radian value for a given y-axis value so I can jump the object to a different point in phase on the same sinewave as a sort of 'teleport'. Importantly I want to be able to teleport to a y-axis value within that wave by deriving the degree point.
for example:
In a sine wave of amplitude = 'A', and frequency = 'F',
What position/s on the wave in degrees (or radians) does the y-axis value 'Y' appear
or worded differently:
using, amplitude = 'A', frequency = 'F' and y-axis position = 'Y', determine the degree's/Radian values that 'Y' can appear
It is my understanding that in most situations there are 2 points for each y-axis value on the wave (except the peak and trough that would have only 1 value)
I would like to know if there is a way to get specifically the point on an incline or decline on the wave
aka, a point between 0 to <90 or >270 to 360 (the rising parts of the wave) or a point between 90 to 270 (the falling part of the wave)
Any help would be greatly appreciated,
Thanks!
I'm having some problems with a bit of trig based maths code I'm am trying to write for a game, The problem is this:
I have an object that is moving in 2d space along the y-axis using a sin wave function.
At any time, given the current amplitude and frequency, I want to be able to get the degree/radian value for a given y-axis value so I can jump the object to a different point in phase on the same sinewave as a sort of 'teleport'. Importantly I want to be able to teleport to a y-axis value within that wave by deriving the degree point.
for example:
In a sine wave of amplitude = 'A', and frequency = 'F',
What position/s on the wave in degrees (or radians) does the y-axis value 'Y' appear
or worded differently:
using, amplitude = 'A', frequency = 'F' and y-axis position = 'Y', determine the degree's/Radian values that 'Y' can appear
It is my understanding that in most situations there are 2 points for each y-axis value on the wave (except the peak and trough that would have only 1 value)
I would like to know if there is a way to get specifically the point on an incline or decline on the wave
aka, a point between 0 to <90 or >270 to 360 (the rising parts of the wave) or a point between 90 to 270 (the falling part of the wave)
Any help would be greatly appreciated,
Thanks!