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
/* This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
Copyright 2021 Peter Dunne */
// pub use super::rectangle_field::*;
// use anyhow::Result;
use ;
// use std::fmt;
// use std::ops::{Add, Mul};
// use crate::magnets::{GetCenter, GetField, MagnetTrait};
use cratePoint3;
use crateAngle;
// use crate::MagnetError;
//TODO: Finish docs
/// A 3D Prismatic magnet
///
/// Arguments using `new()` method:
/// - width (f64): magnet width
/// - height (f64): magnet height
/// - depth (f64): magnet depth
/// - center (Point3): magnet center
/// - alpha (f64):
/// - beta (f64):
/// - gamma (f64):
/// - jr (f64): remnant magnetisation in T
/// - phi (f64): angle of magnetisation w.r.t. x-axis
/// - theta (f64): angle of magnetisation w.r.t. z-axis
///
/// The default method generates a square magnet of size 1.0 x 1.0, x 1.0 centred at
/// (0.0, 0.0, 0.0), magnetised in z with a remnant magnetisation of 1.0 T
/// # Example
/// ```rust
/// use magnet_rs::magnets::Prism;
/// use magnet_rs::utils::conversions::Angle;
/// let magnet_1 = Rectangle::default();
/// println!("Magnet 1:{}", magnet_1);
/// let magnet_2 = Rectangle::new(1.0, 1.0, (0.0, -1.0 / 2.0), Angle::Degrees(0.0), 1.0, Angle::Degrees(90.0));
/// println!("Magnet 2:{}", magnet_2);
/// ```
///