1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! lodestone_core
//!
//! Lodestone_core is a library to calculate the magnetic fields of arbitrary polygons
//! and polyheda in 2D and 3D.
//!
//! //! This test library and binary implements routines for calculating magnetic
//! fields, written in Rust. A more complete Python version can be found on
//! [Github](https://github.com/pdunne/pymagnet), or
//! [PyPi](https://pypi.org/project/pymagnet/)
//!
//! # User friendly magnetic field calculations
//! This library consists of methods for calculating magnetic fields due
//! to simple objects in 2D and 3D.
//!
//!
//!
//! # Calculation Method
//! ## Exact Analytical Methods
//!
//! ## Iterative Method for Cylindrical Sources
// #![warn(missing_docs)]
// #![warn(missing_doc_code_examples)]
// #![allow(dead_code)]
use f64;
pub use MagnetError;
/// Not a number - float64 variant
pub const NAN: f64 = f64NAN;
/// PI
pub const PI: f64 = PI;
/// 2*PI
pub const M2_PI: f64 = PI * 2.0;
/// 4*PI
pub const M4_PI: f64 = PI * 4.0;
/// PI/2
pub const PI_2: f64 = PI / 2.0;
/// PI/3
pub const PI_3: f64 = PI / 3.0;
/// PI/4
pub const PI_4: f64 = PI / 4.0;
/// PI/6
pub const PI_6: f64 = PI / 6.0;
/// 1/(2*PI)
pub const I_2PI: f64 = 1.0 / M2_PI;
/// 1/(2*PI)
pub const I_4PI: f64 = 1.0 / M4_PI;
/// Floating point cutoff for vector alignment 1e-6
pub const FP_CUTOFF: f64 = 1e-6;
/// Floating point cutoff for relative error 1e-12
pub const ERR_CUTOFF: f64 = 1e-12;
/// Maximum number of elements allowed in an array inside a PointArray struct.
/// 10,000.
///
/// This ensures there is no stack overflow when using stack allocated Point arrays.
pub const STACK_MAX: usize = 10000;