From fa2e2f6d08345141e91e550f4cc4d2691ca6c8b5 Mon Sep 17 00:00:00 2001 From: Mikhail Grushinskiy Date: Mon, 9 Sep 2024 09:57:31 -0400 Subject: [PATCH] Update TrochoidalWave.h --- bbn_wave_freq_m5atomS3/TrochoidalWave.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bbn_wave_freq_m5atomS3/TrochoidalWave.h b/bbn_wave_freq_m5atomS3/TrochoidalWave.h index 99f68fb..e81d978 100644 --- a/bbn_wave_freq_m5atomS3/TrochoidalWave.h +++ b/bbn_wave_freq_m5atomS3/TrochoidalWave.h @@ -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 @@ -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