#![allow(unused)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#[inline]
pub fn spring3_energy(
k: f64,
restlen: f64,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* ((((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen)))
.powi(2))
+ (((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen)))
.powi(2))
+ (((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen)))
.powi(2))))
}
#[inline]
pub fn spring3_grad_0_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x1) + (-(x2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x1) + (-(x3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_grad_1_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y1) + (-(y3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_grad_2_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x2) + (-(x1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x2) + (-(x3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_grad_3_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_grad_4_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x3) + (-(x1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x3) + (-(x2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_grad_5_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y3) + (-(y1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
pub fn spring3_grad(
k: f64,
restlen: f64,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
) -> nalgebra::SMatrix<f64, 6, 1> {
let mut result = nalgebra::SMatrix::zeros();
result[(0, 0)] = spring3_grad_0_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(1, 0)] = spring3_grad_1_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(2, 0)] = spring3_grad_2_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(3, 0)] = spring3_grad_3_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(4, 0)] = spring3_grad_4_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(5, 0)] = spring3_grad_5_0(k, restlen, x1, x2, x3, y1, y2, y3);
result
}
#[inline]
pub fn spring3_hess_0_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((x1) + (-(x2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x3))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((x2) + (-(x1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((x3) + (-(x1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_0_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x3)))
* ((y1) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((y3) + (-(y1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_0_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((x2) + (-(x1))))))
}
#[inline]
pub fn spring3_hess_0_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_0_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x3))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x3)))
* ((x3) + (-(x1))))))
}
#[inline]
pub fn spring3_hess_0_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x3)))
* ((y3) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((y1) + (-(y3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_1_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x3)))
* ((y1) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((y3) + (-(y1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_1_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((y1) + (-(y2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y3))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y3)))
* ((y3) + (-(y1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_1_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_1_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y2)))
* ((y2) + (-(y1))))))
}
#[inline]
pub fn spring3_hess_1_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x3) + (-(x1)))
* ((y1) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((y1) + (-(y3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_1_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y3))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y3)))
* ((y3) + (-(y1))))))
}
#[inline]
pub fn spring3_hess_2_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((x2) + (-(x1))))))
}
#[inline]
pub fn spring3_hess_2_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_2_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((x2) + (-(x1))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((x2) + (-(x3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((x2) + (-(x1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((x3) + (-(x2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_2_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x1)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_2_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x2) + (-(x3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((x3) + (-(x2))))))
}
#[inline]
pub fn spring3_hess_2_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_3_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_3_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y2)))
* ((y2) + (-(y1))))))
}
#[inline]
pub fn spring3_hess_3_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x1)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_3_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((y2) + (-(y1))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((y2) + (-(y3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y2) + (-(y3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_3_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_3_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y2) + (-(y3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((y2) + (-(y3)))
* ((y3) + (-(y2))))))
}
#[inline]
pub fn spring3_hess_4_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x3))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x3)))
* ((x3) + (-(x1))))))
}
#[inline]
pub fn spring3_hess_4_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x3) + (-(x1)))
* ((y1) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((y1) + (-(y3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_4_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x2) + (-(x3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((x3) + (-(x2))))))
}
#[inline]
pub fn spring3_hess_4_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_4_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((x3) + (-(x1))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((x3) + (-(x2))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((x3) + (-(x1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((x3) + (-(x2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_4_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x3) + (-(x1)))
* ((y3) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x1)))
* ((y1) + (-(y3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x2)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_5_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x3)))
* ((y3) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x3)))
* ((y1) + (-(y3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_5_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y3))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y3)))
* ((y3) + (-(y1))))))
}
#[inline]
pub fn spring3_hess_5_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_5_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y2) + (-(y3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((y2) + (-(y3)))
* ((y3) + (-(y2))))))
}
#[inline]
pub fn spring3_hess_5_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip())
* ((x3) + (-(x1)))
* ((y3) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x1)))
* ((y1) + (-(y3)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x2)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring3_hess_5_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
y1: f64,
y2: f64,
y3: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((y3) + (-(y1))).powi(2))
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((y3) + (-(y2))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y3)))
* ((y3) + (-(y1)))
* ((((((x3) + (-(x1))).powi(2)) + (((y3) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y2) + (-(y3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
pub fn spring3_hess(
k: f64,
restlen: f64,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
) -> nalgebra::SMatrix<f64, 6, 6> {
let mut result = nalgebra::SMatrix::zeros();
result[(0, 0)] = spring3_hess_0_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(0, 1)] = spring3_hess_0_1(k, restlen, x1, x2, x3, y1, y2, y3);
result[(0, 2)] = spring3_hess_0_2(k, restlen, x1, x2, x3, y1, y2, y3);
result[(0, 3)] = spring3_hess_0_3(k, restlen, x1, x2, x3, y1, y2, y3);
result[(0, 4)] = spring3_hess_0_4(k, restlen, x1, x2, x3, y1, y2, y3);
result[(0, 5)] = spring3_hess_0_5(k, restlen, x1, x2, x3, y1, y2, y3);
result[(1, 0)] = spring3_hess_1_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(1, 1)] = spring3_hess_1_1(k, restlen, x1, x2, x3, y1, y2, y3);
result[(1, 2)] = spring3_hess_1_2(k, restlen, x1, x2, x3, y1, y2, y3);
result[(1, 3)] = spring3_hess_1_3(k, restlen, x1, x2, x3, y1, y2, y3);
result[(1, 4)] = spring3_hess_1_4(k, restlen, x1, x2, x3, y1, y2, y3);
result[(1, 5)] = spring3_hess_1_5(k, restlen, x1, x2, x3, y1, y2, y3);
result[(2, 0)] = spring3_hess_2_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(2, 1)] = spring3_hess_2_1(k, restlen, x1, x2, x3, y1, y2, y3);
result[(2, 2)] = spring3_hess_2_2(k, restlen, x1, x2, x3, y1, y2, y3);
result[(2, 3)] = spring3_hess_2_3(k, restlen, x1, x2, x3, y1, y2, y3);
result[(2, 4)] = spring3_hess_2_4(k, restlen, x1, x2, x3, y1, y2, y3);
result[(2, 5)] = spring3_hess_2_5(k, restlen, x1, x2, x3, y1, y2, y3);
result[(3, 0)] = spring3_hess_3_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(3, 1)] = spring3_hess_3_1(k, restlen, x1, x2, x3, y1, y2, y3);
result[(3, 2)] = spring3_hess_3_2(k, restlen, x1, x2, x3, y1, y2, y3);
result[(3, 3)] = spring3_hess_3_3(k, restlen, x1, x2, x3, y1, y2, y3);
result[(3, 4)] = spring3_hess_3_4(k, restlen, x1, x2, x3, y1, y2, y3);
result[(3, 5)] = spring3_hess_3_5(k, restlen, x1, x2, x3, y1, y2, y3);
result[(4, 0)] = spring3_hess_4_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(4, 1)] = spring3_hess_4_1(k, restlen, x1, x2, x3, y1, y2, y3);
result[(4, 2)] = spring3_hess_4_2(k, restlen, x1, x2, x3, y1, y2, y3);
result[(4, 3)] = spring3_hess_4_3(k, restlen, x1, x2, x3, y1, y2, y3);
result[(4, 4)] = spring3_hess_4_4(k, restlen, x1, x2, x3, y1, y2, y3);
result[(4, 5)] = spring3_hess_4_5(k, restlen, x1, x2, x3, y1, y2, y3);
result[(5, 0)] = spring3_hess_5_0(k, restlen, x1, x2, x3, y1, y2, y3);
result[(5, 1)] = spring3_hess_5_1(k, restlen, x1, x2, x3, y1, y2, y3);
result[(5, 2)] = spring3_hess_5_2(k, restlen, x1, x2, x3, y1, y2, y3);
result[(5, 3)] = spring3_hess_5_3(k, restlen, x1, x2, x3, y1, y2, y3);
result[(5, 4)] = spring3_hess_5_4(k, restlen, x1, x2, x3, y1, y2, y3);
result[(5, 5)] = spring3_hess_5_5(k, restlen, x1, x2, x3, y1, y2, y3);
result
}
#[inline]
pub fn spring4_energy(
k: f64,
restlen: f64,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
x4: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* ((((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen)))
.powi(2))
+ (((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen)))
.powi(2))
+ (((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen)))
.powi(2))
+ (((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen)))
.powi(2))))
}
#[inline]
pub fn spring4_grad_0_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x1) + (-(x2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x1) + (-(x4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_grad_1_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y1) + (-(y4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_grad_2_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x2) + (-(x1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x2) + (-(x3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_grad_3_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_grad_4_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x3) + (-(x2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x3) + (-(x4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_grad_5_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y3) + (-(y4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_grad_6_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x4) + (-(x1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((x4) + (-(x3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_grad_7_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y4) + (-(y1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((y4) + (-(y3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
pub fn spring4_grad(
k: f64,
restlen: f64,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
x4: f64,
y4: f64,
) -> nalgebra::SMatrix<f64, 8, 1> {
let mut result = nalgebra::SMatrix::zeros();
result[(0, 0)] = spring4_grad_0_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 0)] = spring4_grad_1_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 0)] = spring4_grad_2_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 0)] = spring4_grad_3_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 0)] = spring4_grad_4_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 0)] = spring4_grad_5_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 0)] = spring4_grad_6_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 0)] = spring4_grad_7_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result
}
#[inline]
pub fn spring4_hess_0_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((x1) + (-(x2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x4))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((x2) + (-(x1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((x4) + (-(x1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_0_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x4)))
* ((y1) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((y4) + (-(y1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_0_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((x2) + (-(x1))))))
}
#[inline]
pub fn spring4_hess_0_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub const fn spring4_hess_0_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_0_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub fn spring4_hess_0_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x4))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x4)))
* ((x4) + (-(x1))))))
}
#[inline]
pub fn spring4_hess_0_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x4)))
* ((y4) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((y1) + (-(y4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_1_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x4)))
* ((y1) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((y4) + (-(y1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_1_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((y1) + (-(y2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y4))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y4)))
* ((y4) + (-(y1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_1_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_1_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y2)))
* ((y2) + (-(y1))))))
}
#[inline]
pub const fn spring4_hess_1_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_1_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub fn spring4_hess_1_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x4) + (-(x1)))
* ((y1) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((y1) + (-(y4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_1_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y4))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y4)))
* ((y4) + (-(y1))))))
}
#[inline]
pub fn spring4_hess_2_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((x2) + (-(x1))))))
}
#[inline]
pub fn spring4_hess_2_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y1) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_2_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((x2) + (-(x1))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((x2) + (-(x3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((x2) + (-(x1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((x3) + (-(x2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_2_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x1)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_2_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x2) + (-(x3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((x3) + (-(x2))))))
}
#[inline]
pub fn spring4_hess_2_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub const fn spring4_hess_2_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_2_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub fn spring4_hess_3_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x2)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x2)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_3_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y2))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y2)))
* ((y2) + (-(y1))))))
}
#[inline]
pub fn spring4_hess_3_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip())
* ((x2) + (-(x1)))
* ((y2) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x1)))
* ((y1) + (-(y2)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_3_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((y2) + (-(y1))).powi(2))
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((y2) + (-(y3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y2)))
* ((y2) + (-(y1)))
* ((((((x2) + (-(x1))).powi(2)) + (((y2) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y2) + (-(y3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_3_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_3_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y2) + (-(y3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((y2) + (-(y3)))
* ((y3) + (-(y2))))))
}
#[inline]
pub const fn spring4_hess_3_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_3_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_4_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_4_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub fn spring4_hess_4_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x2) + (-(x3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((x3) + (-(x2))))))
}
#[inline]
pub fn spring4_hess_4_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y2) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_4_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((x3) + (-(x2))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((x3) + (-(x4))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((x3) + (-(x2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((x4) + (-(x3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_4_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x3) + (-(x4)))
* ((y3) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x2)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((y4) + (-(y3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_4_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x3) + (-(x4))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x3) + (-(x4)))
* ((x4) + (-(x3))))))
}
#[inline]
pub fn spring4_hess_4_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x3) + (-(x4)))
* ((y4) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((y3) + (-(y4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub const fn spring4_hess_5_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_5_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub fn spring4_hess_5_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x2) + (-(x3)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x2) + (-(x3)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_5_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y2) + (-(y3))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((y2) + (-(y3)))
* ((y3) + (-(y2))))))
}
#[inline]
pub fn spring4_hess_5_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip())
* ((x3) + (-(x2)))
* ((y3) + (-(y2))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x3) + (-(x4)))
* ((y3) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x2)))
* ((y2) + (-(y3)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((y4) + (-(y3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_5_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((y3) + (-(y2))).powi(2))
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((y3) + (-(y4))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y2) + (-(y3)))
* ((y3) + (-(y2)))
* ((((((x3) + (-(x2))).powi(2)) + (((y3) + (-(y2))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y3) + (-(y4)))
* ((y4) + (-(y3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_5_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x4) + (-(x3)))
* ((y3) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((y3) + (-(y4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_5_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y3) + (-(y4))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((y3) + (-(y4)))
* ((y4) + (-(y3))))))
}
#[inline]
pub fn spring4_hess_6_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x1) + (-(x4))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x4)))
* ((x4) + (-(x1))))))
}
#[inline]
pub fn spring4_hess_6_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x4) + (-(x1)))
* ((y1) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((y1) + (-(y4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub const fn spring4_hess_6_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_6_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub fn spring4_hess_6_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((x3) + (-(x4))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x3) + (-(x4)))
* ((x4) + (-(x3))))))
}
#[inline]
pub fn spring4_hess_6_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x4) + (-(x3)))
* ((y3) + (-(y4))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((y3) + (-(y4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_6_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((x4) + (-(x1))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((x4) + (-(x3))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((x4) + (-(x1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((x4) + (-(x3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_6_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x4) + (-(x1)))
* ((y4) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x4) + (-(x3)))
* ((y4) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x4) + (-(x1)))
* ((y1) + (-(y4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x4) + (-(x3)))
* ((y3) + (-(y4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_7_0(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x1) + (-(x4)))
* ((y4) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x1) + (-(x4)))
* ((y1) + (-(y4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_7_1(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y1) + (-(y4))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((y1) + (-(y4)))
* ((y4) + (-(y1))))))
}
#[inline]
pub const fn spring4_hess_7_2(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub const fn spring4_hess_7_3(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
0_f64
}
#[inline]
pub fn spring4_hess_7_4(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x3) + (-(x4)))
* ((y4) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x3) + (-(x4)))
* ((y3) + (-(y4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_7_5(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((-2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt()) + (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((y3) + (-(y4))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((y3) + (-(y4)))
* ((y4) + (-(y3))))))
}
#[inline]
pub fn spring4_hess_7_6(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip())
* ((x4) + (-(x1)))
* ((y4) + (-(y1))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip())
* ((x4) + (-(x3)))
* ((y4) + (-(y3))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x4) + (-(x1)))
* ((y1) + (-(y4)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((x4) + (-(x3)))
* ((y3) + (-(y4)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
#[inline]
pub fn spring4_hess_7_7(
k: f64,
restlen: f64,
x1: f64,
x2: f64,
x3: f64,
x4: f64,
y1: f64,
y2: f64,
y3: f64,
y4: f64,
) -> f64 {
((0.500000000000000_f64)
* (k)
* (((2.0000000000000000000_f64)
* (((y4) + (-(y1))).powi(2))
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((y4) + (-(y3))).powi(2))
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).recip()))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-0.50000000000000000000_f64))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y1) + (-(y4)))
* ((y4) + (-(y1)))
* ((((((x4) + (-(x1))).powi(2)) + (((y4) + (-(y1))).powi(2))).sqrt())
+ (-(restlen))))
+ ((2.0000000000000000000_f64)
* (((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2)))
.powf(-1.5000000000000000000_f64))
* ((y3) + (-(y4)))
* ((y4) + (-(y3)))
* ((((((x4) + (-(x3))).powi(2)) + (((y4) + (-(y3))).powi(2))).sqrt())
+ (-(restlen))))))
}
pub fn spring4_hess(
k: f64,
restlen: f64,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
x4: f64,
y4: f64,
) -> nalgebra::SMatrix<f64, 8, 8> {
let mut result = nalgebra::SMatrix::zeros();
result[(0, 0)] = spring4_hess_0_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(0, 1)] = spring4_hess_0_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(0, 2)] = spring4_hess_0_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(0, 3)] = spring4_hess_0_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(0, 4)] = spring4_hess_0_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(0, 5)] = spring4_hess_0_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(0, 6)] = spring4_hess_0_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(0, 7)] = spring4_hess_0_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 0)] = spring4_hess_1_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 1)] = spring4_hess_1_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 2)] = spring4_hess_1_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 3)] = spring4_hess_1_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 4)] = spring4_hess_1_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 5)] = spring4_hess_1_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 6)] = spring4_hess_1_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(1, 7)] = spring4_hess_1_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 0)] = spring4_hess_2_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 1)] = spring4_hess_2_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 2)] = spring4_hess_2_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 3)] = spring4_hess_2_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 4)] = spring4_hess_2_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 5)] = spring4_hess_2_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 6)] = spring4_hess_2_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(2, 7)] = spring4_hess_2_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 0)] = spring4_hess_3_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 1)] = spring4_hess_3_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 2)] = spring4_hess_3_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 3)] = spring4_hess_3_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 4)] = spring4_hess_3_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 5)] = spring4_hess_3_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 6)] = spring4_hess_3_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(3, 7)] = spring4_hess_3_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 0)] = spring4_hess_4_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 1)] = spring4_hess_4_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 2)] = spring4_hess_4_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 3)] = spring4_hess_4_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 4)] = spring4_hess_4_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 5)] = spring4_hess_4_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 6)] = spring4_hess_4_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(4, 7)] = spring4_hess_4_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 0)] = spring4_hess_5_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 1)] = spring4_hess_5_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 2)] = spring4_hess_5_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 3)] = spring4_hess_5_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 4)] = spring4_hess_5_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 5)] = spring4_hess_5_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 6)] = spring4_hess_5_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(5, 7)] = spring4_hess_5_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 0)] = spring4_hess_6_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 1)] = spring4_hess_6_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 2)] = spring4_hess_6_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 3)] = spring4_hess_6_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 4)] = spring4_hess_6_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 5)] = spring4_hess_6_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 6)] = spring4_hess_6_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(6, 7)] = spring4_hess_6_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 0)] = spring4_hess_7_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 1)] = spring4_hess_7_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 2)] = spring4_hess_7_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 3)] = spring4_hess_7_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 4)] = spring4_hess_7_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 5)] = spring4_hess_7_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 6)] = spring4_hess_7_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result[(7, 7)] = spring4_hess_7_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);
result
}