ddg.math.complex module

Complex analysis for plane geometry.

ddg.math.complex.complex_sample(size=None)[source]

Wraps random_sample() to get corresponding number of complex valued samples where real and imaginary part are identically uniformly distributed on [0,1]

ddg.math.complex.to_array(z)[source]

Corresponding element in R^2

ddg.math.complex.to_complex(x)[source]

Converts 2D-array to complex number

ddg.math.complex.homogeneous(z)[source]

Homogeneous coordinates in CP^2 interpreting z as affine coordinates.

ddg.math.complex.scalar_product(z1, z2)[source]

Real scalar product of the corresponding elements in R^2

ddg.math.complex.determinant(z1, z2)[source]

Real determinant of the corresponding elements in R^2

ddg.math.complex.rel_angle(u, v)[source]

Positive angle in [0,2*pi) between complex numbers u,v

ddg.math.complex.cr(z1, z2, z3, z4)[source]

Complex cross-ratio (z1 - z2)/(z2 - z3) * (z3 - z4)/(z4 - z1)

ddg.math.complex.fourth_point_from_cross_ratio(z, z1, z2, q)[source]

Get z12 in cr(z, z1, z12, z2) = q

ddg.math.complex.triangle_area_from_lengths(a, b, c)[source]

Numerically stable version of Heron’s formula for the area of a tringagle with side lengths a,b,c.

ddg.math.complex.circumcircle_center(z1, z2, z3)[source]
ddg.math.complex.circumcircle_radius(z1, z2, z3)[source]
ddg.math.complex.diagonals_intersection(z1, z2, z3, z4)[source]
ddg.math.complex.intersect_edges(z1, z2, z3, z4)[source]