We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Taking Static Type-Safety to the Next Level - Physical Units for Matrices - Daniel Withopf CppCon 22
Discover how adding physical units to vectors and matrices can enhance type-safety, prevent invalid operations, infer units, create expressive names, detect errors, and more. Explore the power of physical units in C++.
- Physical units can be added to vectors and matrices. This allows you to represent quantities like velocity and acceleration in a way that is both mathematically correct and easy to understand.
- Physical units can be used to prevent invalid operations. For example, you can’t add a velocity vector to a position vector, because the units don’t match up.
- Physical units can be used to infer the units of the result of an operation. For example, if you add two velocity vectors, the result will have units of velocity.
- Physical units can be used to create expressive and enforced names for vector and matrix entries. This makes it easier to understand what the code is doing and to avoid errors.
- Physical units can be used to detect dangling references and aliasing. This helps to prevent bugs that can be difficult to find.
- Physical units can be used to prevent out-of-bounds accesses. This helps to prevent undefined behavior and crashes.
- Physical units can be used to represent non-uniform vectors and matrices. This allows you to represent quantities that vary in different directions or over time.
- Physical units can be used to create a taxonomy of all different types of vectors and matrices. This makes it easier to understand the relationships between different types and to choose the right type for a given task.
- Physical units can be used to represent transformations between different coordinate frames. This allows you to translate and rotate vectors and matrices in a way that is both mathematically correct and easy to understand.
- Physical units can be used to represent Jacobians and other derivatives. This allows you to represent the relationship between the input and output of a function in a way that is both mathematically correct and easy to understand.