Open
Description
Section 16 Science
EDIT - Some ideas here are not accepted yet, please comment here and wait for separate "example" implementation issues before submitting a PR 👍
Mathematics
Here are a bunch of ideas related to mathematics. Some can be implemented with Rust primitives, other can show how to use the num
crate. Maybe some other crates can be used, but I am not too familiar with the math crates. Please, if you have additional ideas let me know, I can keep this first post up-to-date.
Basic mathematics functions
- cosinus, sinus with Rust primitives (
f32
,f64
) or/and withnum
. Highlight the differences between the two? - Compute distance latitude/longitude points. Good example to show trigonometric functions.
- Implement some activation functions to highlight exp, log, tan(h), max, abs. Activation functions are used in neural networks and in computer chip circuits.
Simple statistics
- For a given data series, compute the average, the median, the standard deviation and the mode
Manipulation
- truncate/round decimal number to a lower precision. Take into account a precision, i.e.
- precision 1:
1/3 = 0
- precision 2:
1/3 = 0.3
, and so forth.
- precision 1:
Complex numbers
via num
crate, show some usage of complex numbers.
Geometry examples:
- 3 points are collinear (they are aligned). 2 lines are perpendicular. 2 lines are parallel.
Big Numbers
- Compute factorial or Fibonacci which yield a big number (bigger than u128).
num
crate hasBigInt
concept.
Basic algebra
I am not aware of a good crate for this section, so I am not sure this a good candidate for the cookbook. However, here are some ideas.
- Add two vectors
- Norm of two vectors
- A vector time a matrix
- Add, multiply two matrix
- invert a Matrix
- A scalar time a vector time a matrix
- Serialize/Deserialize a big matrix
If you are happy with this, next we can discuss how many recipes/issues can be created, I think several ideas can be fitted in one recipe.