What’s the best way to write Mathematical Equations on the Web?

The jsMath package is an option that uses LaTeX markup and native fonts. Quoting from their webpage http://www.math.union.edu/~dpvc/jsMath/: The jsMath package provides a method of including mathematics in HTML pages that works across multiple browsers under Windows, Macintosh OS X, Linux and other flavors of unix. It overcomes a number of the shortcomings of the … Read more

Convert Linear scale to Logarithmic

Notation As is the convention both in mathematics and programming, the “log” function is taken to be base-e. The “exp” function is the exponential function. Remember that these functions are inverses we take the functions as: exp : ℝ → ℝ+, and log : ℝ+ → ℝ. Solution You’re just solving a simple equation here: … Read more

Why does floating-point arithmetic not give exact results when adding decimal fractions?

Binary floating point math is like this. In most programming languages, it is based on the IEEE 754 standard. The crux of the problem is that numbers are represented in this format as a whole number times a power of two; rational numbers (such as 0.1, which is 1/10) whose denominator is not a power … Read more

“Average” of multiple quaternions?

Contrary to popular belief in the computer graphics industry, there is a straightforward algorithm to solve this problem which is robust, accurate, and simple that comes from the aerospace industry. It runs in time linear in the number of quaternions being averaged plus a (largish) constant factor. Let Q = [a1q1, a2q2, …, anqn], where … Read more

Do not want scientific notation on plot axis

Use options(scipen=5) or some other high enough number. The scipen option determines how likely R is to switch to scientific notation, the higher the value the less likely it is to switch. Set the option before making your plot, if it still has scientific notation, set it to a higher number.