Skip to content

Commit

Permalink
Merge branch 'feat/nova-visualizer/randomize-period' into feat/nova-v…
Browse files Browse the repository at this point in the history
…isualizer/randomize-amplitude
  • Loading branch information
VmMad committed Feb 22, 2024
2 parents 02bb2c3 + bf80194 commit 8d6c88d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions client/src/features/visualizer-threejs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export const EMITTER_X_POSITION_MULTIPLIER = 3;

/* Values for randomizing the tangle */
export const NUMBER_OF_RANDOM_PERIODS = 100;
export const MIN_SINUSOID_HALF_PERIOD = 5;
export const MAX_SINUSOID_HALF_PERIOD = 8;
export const MIN_SINUSOID_PERIOD = 5;
export const MAX_SINUSOID_PERIOD = 8;

export const NUMBER_OF_RANDOM_AMPLITUDES = 100;
export const MIN_SINUSOID_AMPLITUDE = 100;
Expand Down
6 changes: 3 additions & 3 deletions client/src/features/visualizer-threejs/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
CAMERA_X_OFFSET,
CAMERA_Y_OFFSET,
NUMBER_OF_RANDOM_PERIODS,
MIN_SINUSOID_HALF_PERIOD,
MAX_SINUSOID_HALF_PERIOD,
MIN_SINUSOID_PERIOD,
MAX_SINUSOID_PERIOD,
NUMBER_OF_RANDOM_AMPLITUDES,
MIN_SINUSOID_AMPLITUDE,
MAX_SINUSOID_AMPLITUDE,
Expand Down Expand Up @@ -290,7 +290,7 @@ export function positionToVector(position: IThreeDimensionalPosition) {
export function generateRandomPeriods(): { periods: number[]; sum: number } {
let sum = 0;
const periods = Array.from({ length: NUMBER_OF_RANDOM_PERIODS }, () => {
const period = Number(randomNumberFromInterval(MIN_SINUSOID_HALF_PERIOD, MAX_SINUSOID_HALF_PERIOD).toFixed(4));
const period = Number(randomNumberFromInterval(MIN_SINUSOID_PERIOD, MAX_SINUSOID_PERIOD).toFixed(4));
sum += period;
return period;
});
Expand Down

0 comments on commit 8d6c88d

Please sign in to comment.