ChaosPro Home
Introduction
What's New
Palettes
Using Formulas
Layering in ChaosPro
Rendering
Fractal Parameter Windows
Windows
Menu
3D Transformations
Animations
Formula Compiler
Writing Formulas
Language Reference
Introduction
Basic Syntax
Datatypes
Constants
Variables
Expressions
Operators
Functions
Arithmetic
Conversion
Color
Trigonometric
sin
cos
sincos
tan
cotan
sinh
cosh
tanh
cotanh
asin
acos
atan
acot
asinh
acosh
atanh
acoth
exp
ln
log
log10
atan2
arg
cosxx
Miscellaneous
Control Structures
Compiler Directives
Functions
Interface to ChaosPro
Special Features, Notes...
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Predefined Functions - ln

Function name:ln - Natural logarithm
Synopsis:ln(x)

Input data type Output data type
real real
complex complex
quaternion quaternion


Description:

The natural logarithm may be written either as log or as ln. These two functions are the same.

The logarithm of a complex or quaternion number is not uniquely defined. Mathematically the logarithm of a complex or quaternion number has an unlimited number of solutions. The solution calculated in ChaosPro is the main branch of the logarithm.

ChaosPro automatically detects the input data type.

In order to calculate ln(z) (z = any complex number) ChaosPro performs the following calculation:

ln(z) = 0.5*(ln(x^2+y^2))+i*arctan(y/x)

For the definition of arctan(x) see:



In order to calculate ln(q) (q = quaternion number) ChaosPro performs the following calculation:

quaternion fr_ln(quaternion q)
{
quaternion ret;

	n = sqrt( sqr(real(loquat(q))) + sqr(imag(loquat(q))) +sqr(imag(q)) );
	f = arg(real(q)/n+flip(1));
	f = f/n;
	c0 = 0.5*ln(sqr(real(q)) + n*n);
	c1 = f*imag(q);
	c2 = f*real(loquat(q));
	c3 = f*imag(loquat(q));
	ret = loquat(c2+flip(c3))+c0+flip(c1);
	return(ret);
}