From 401fd846cb2249e575ff157b4fcf2ad054113e29 Mon Sep 17 00:00:00 2001 From: Mikhail Grushinskiy Date: Fri, 20 Sep 2024 15:12:52 -0400 Subject: [PATCH] Update TrochoidalWave.h --- bbn_wave_freq_m5atomS3/TrochoidalWave.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bbn_wave_freq_m5atomS3/TrochoidalWave.h b/bbn_wave_freq_m5atomS3/TrochoidalWave.h index 65e3568..d8c4f71 100644 --- a/bbn_wave_freq_m5atomS3/TrochoidalWave.h +++ b/bbn_wave_freq_m5atomS3/TrochoidalWave.h @@ -34,14 +34,17 @@ float trochoid_wave_freq(float displacement, float accel) { 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); + return displacement; } 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 vert_speed = 2.0 * PI * frequency * displacement_amplitude * sin(2.0 * PI * frequency * t + phase_rad); + return vert_speed; } 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); + float vert_accel = pow(2.0 * PI * frequency, 2) * displacement_amplitude * cos(2.0 * PI * frequency * t + phase_rad); + return vert_accel; } #endif