Skip to content

Commit

Permalink
Update TrochoidalWave.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch authored Sep 20, 2024
1 parent 235972f commit a42c8d3
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions bbn_wave_freq_m5atomS3/TrochoidalWave.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
*/

float trochoid_wave_displacement(float displacement_amplitude, float frequency, float t);
float trochoid_wave_vert_speed(float displacement_amplitude, float frequency, float t);
float trochoid_wave_vert_accel(float displacement_amplitude, float frequency, float t);

float trochoid_wave_length(float periodSec);
float trochoid_wave_period(float height, float accel);
float trochoid_wave_freq(float height, float accel);
float trochoid_wave_period(float displacement, float accel);
float trochoid_wave_freq(float displacement, float accel);

const float g_std = 9.80665; // standard gravity acceleration m/s2

Expand All @@ -18,15 +22,26 @@ float trochoid_wave_length(float periodSec) {
return lengthMeters;
}

float trochoid_wave_period(float height, float accel) {
float wave_period = 2.0 * PI * sqrt(fabs(height / accel));
float trochoid_wave_period(float displacement, float accel) {
float wave_period = 2.0 * PI * sqrt(fabs(displacement / accel));
return wave_period;
}

float trochoid_wave_freq(float height, float accel) {
float wave_freq = sqrt(fabs(accel / height)) / (2.0 * PI);
float trochoid_wave_freq(float displacement, float accel) {
float wave_freq = sqrt(fabs(accel / displacement)) / (2.0 * PI);
return wave_freq;
}

float trochoid_wave_displacement(float displacement_amplitude, float frequency, float phase_rad, float t) {
float displacement = - displacement_amplitude * cos(2.0 * PI * frequency * t + phase_rad);
}

float trochoid_wave_vert_speed(float displacement_amplitude, float frequency, float phase_rad, float t) {
float displacement = 2.0 * PI * frequency * displacement_amplitude * sin(2.0 * PI * frequency * t + phase_rad);
}

float trochoid_wave_vert_accel(float displacement_amplitude, float frequency, float phase_rad, float t) {
float displacement = pow(2.0 * PI * frequency, 2) * displacement_amplitude * cos(2.0 * PI * frequency * t + phase_rad);
}

#endif

0 comments on commit a42c8d3

Please sign in to comment.