Skip to content

Cookbook ideas for "Science" section #362

Open
@ludwigpacifici

Description

@ludwigpacifici

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

  1. cosinus, sinus with Rust primitives (f32, f64) or/and with num. Highlight the differences between the two?
  2. Compute distance latitude/longitude points. Good example to show trigonometric functions.
  3. 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

  1. For a given data series, compute the average, the median, the standard deviation and the mode

Manipulation

  1. 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.

Complex numbers

via num crate, show some usage of complex numbers.

Geometry examples:

  1. 3 points are collinear (they are aligned). 2 lines are perpendicular. 2 lines are parallel.

Big Numbers

  1. Compute factorial or Fibonacci which yield a big number (bigger than u128). num crate has BigInt 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions