Difference between revisions of "Algorithms"

From Wiki at Neela Nurseries
Jump to navigation Jump to search
(Add link to Algorithmica dot org article on integer division)
 
m (Create section q Pitch Yaw and Roll q)
 
(6 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
*  https://en.algorithmica.org/hpc/arithmetic/division/
 
*  https://en.algorithmica.org/hpc/arithmetic/division/
 +
 +
*  https://gmplib.org/
 +
 +
== Books on Algorithms ==
 +
 +
Here a brief list of books about algorithms and on many cases their applications in computer programming . . .
 +
 +
*  https://www.reddit.com/r/algorithms/comments/i8qb3k/good_books_learning_about_algorithms_from_very/
 +
*  https://news.ycombinator.com/item?id=6463011
 +
 +
== Integer Math ==
 +
 +
Possible Rust crate for integer math functions, does not presently require use of Rust `std` crate:
 +
 +
*  https://docs.rs/num-integer/0.1.46/num_integer/fn.div_rem.html
 +
 +
Figuring compass directions:
 +
 +
*  https://digilent.com/blog/how-to-convert-magnetometer-data-into-compass-heading/
 +
 +
To figure pitch and roll:
 +
 +
*  https://forum.arduino.cc/t/sensing-tilt-using-accelerometer-alone/135717/5
 +
 +
== Pitch Yaw and Roll ==
 +
 +
Pitch, yaw and roll:
 +
 +
*  https://simple.wikipedia.org/wiki/Pitch%2C_yaw%2C_and_roll
 +
 +
<!--
 +
johnwasser
 +
Karma: 2000+
 +
Dec 2012
 +
post #6
 +
When you tilt the X axis up past 90 degrees, the Z axis goes through zero and then starts going positive. Since yrot is based on the X and Z measurements, when Z goes from negative to positive you get a different answer, even though Y is staying near zero.
 +
 +
To get pitch and roll, try:
 +
 +
pitch=atan2(ax,sqrt((ay*ay)+(az*az)))
 +
roll=atan2(ay,sqrt((ax*ax)+(az*az)))
 +
Note that the result is in Radians so if you want degrees you still have to convert. You shouldn't get a problem with both arguments to atan2() being zero unless your accelerometer is in free-fall. 
 +
 +
-->
 +
 +
Some fixed point trigonometry shared by engineer James Munns:
 +
 +
*  https://jamesmunns.com/blog/fixed-point-math/

Latest revision as of 14:55, 15 February 2026

Integer division:

Link to Algorithmica dot org article on integer division:

Books on Algorithms

Here a brief list of books about algorithms and on many cases their applications in computer programming . . .

Integer Math

Possible Rust crate for integer math functions, does not presently require use of Rust `std` crate:

Figuring compass directions:

To figure pitch and roll:

Pitch Yaw and Roll

Pitch, yaw and roll:


Some fixed point trigonometry shared by engineer James Munns: