-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.txt
28 lines (23 loc) · 1.02 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Diamond (after Neil Diamond)
Author: Neil Crago
Date: 20/02/2024
Description:
A Program to generate:-
1.) an S-curve
2.) a front-loaded curve
3.) a back-loaded curve
4.) reveals the `california envelope` when the resulting CSV is plotted
Note: Data is written to `diamond.csv`
Explanation:
1. `s_curve` function:
- Takes three arguments:
- `t`: Represents the normalized time (0.0 to 1.0).
- `a`: Controls the starting curvature (higher `a` for more emphasis at the beginning).
- `b`: Controls the ending curvature (higher `b` for more emphasis at the end).
2. The function uses a cubic equation with `t` cubed for a smooth S-shape.
3. `(3.0 - 2.0 * t)` acts as a weighting factor that changes over time.
4. `(a + b * t)` combines the starting and ending curvatures.
5. `main` function:
- Loops through time values from 0.0 to 1.0 with increments.
- Calculates the S-curve value for each time step using different combinations of `a` and `b`.
- Prints the corresponding time (`t`) and S-curve value (`y`).