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 9, 2024
1 parent debda04 commit fa2e2f6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bbn_wave_freq_m5atomS3/TrochoidalWave.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
*/

float trochoid_wave_length(float periodSec);
float trochoid_wave_period(float wave_height, float amp_range);
float trochoid_wave_period(float height, float accel);
float trochoid_wave_freq(float height, float accel);

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

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

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

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


#endif

0 comments on commit fa2e2f6

Please sign in to comment.