use super::*;
use f2rust_std::*;
const VTIGHT: f64 = 0.00000000000001;
const TIGHT: f64 = 0.000000000001;
pub fn F_ZZSGLATX(OK: &mut bool, ctx: &mut Context) -> f2rust_std::Result<()> {
let mut DIFF = StackArray::<f64, 3>::new(1..=3);
let mut DIR = StackArray::<f64, 3>::new(1..=3);
let mut DIST: f64 = 0.0;
let mut DP: f64 = 0.0;
let mut MAG: f64 = 0.0;
let mut MAXLAT: f64 = 0.0;
let mut MAXP = StackArray::<f64, 3>::new(1..=3);
let mut MINLAT: f64 = 0.0;
let mut MINP = StackArray::<f64, 3>::new(1..=3);
let mut P1 = StackArray::<f64, 3>::new(1..=3);
let mut P2 = StackArray::<f64, 3>::new(1..=3);
let mut SQ2: f64 = 0.0;
let mut SQ22: f64 = 0.0;
let mut XMAXLT: f64 = 0.0;
let mut XMAXP = StackArray::<f64, 3>::new(1..=3);
let mut XMINLT: f64 = 0.0;
let mut XMINP = StackArray::<f64, 3>::new(1..=3);
testutil::TOPEN(b"F_ZZSGLATX", ctx)?;
testutil::TCASE(b"Tangent case: segment parallel to X-Y plane, Z>0", ctx)?;
SQ2 = f64::sqrt(2.0);
SQ22 = (SQ2 / 2.0);
spicelib::VPACK(1.0, -SQ2, 1.0, P1.as_slice_mut());
spicelib::VPACK(1.0, SQ2, 1.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VPACK(1.0, 0.0, 1.0, XMAXP.as_slice_mut());
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMAXLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
spicelib::VEQU(P1.as_slice(), XMINP.as_slice_mut());
if (MINP[2] > 0.0) {
XMINP[2] = -XMINP[2];
}
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMINLT = (spicelib::PI(ctx) / 6 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(
b"Tangent case: segment parallel to X-Y plane, Z>0, segment max Y is at X-Z plane.",
ctx,
)?;
spicelib::VPACK(1.0, -SQ2, 1.0, P1.as_slice_mut());
spicelib::VPACK(1.0, 0.0, 1.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VPACK(1.0, 0.0, 1.0, XMAXP.as_slice_mut());
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMAXLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
spicelib::VEQU(P1.as_slice(), XMINP.as_slice_mut());
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMINLT = (spicelib::PI(ctx) / 6 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(
b"Tangent case: segment parallel to X-Y plane, Z>0, segment min Y is at X-Z plane.",
ctx,
)?;
spicelib::VPACK(1.0, 0.0, 1.0, P1.as_slice_mut());
spicelib::VPACK(1.0, SQ2, 1.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VPACK(1.0, 0.0, 1.0, XMAXP.as_slice_mut());
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMAXLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
spicelib::VEQU(P2.as_slice(), XMINP.as_slice_mut());
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMINLT = (spicelib::PI(ctx) / 6 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(
b"Tangent case: segment non parallel to X-Y plane, Z>0, segment min Y is negative.",
ctx,
)?;
spicelib::VPACK(1.0, -SQ2, 1.0, P1.as_slice_mut());
spicelib::VPACK(3.0, SQ2, 3.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VLCOM(0.5, P1.as_slice(), 0.5, P2.as_slice(), XMAXP.as_slice_mut());
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMAXLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
spicelib::VEQU(P1.as_slice(), XMINP.as_slice_mut());
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMINLT = (spicelib::PI(ctx) / 6 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(
b"Tangent case: segment parallel to X-Y plane, Z>0, segment max Y is at X-Z plane.",
ctx,
)?;
spicelib::VPACK(1.0, -SQ2, 1.0, P1.as_slice_mut());
spicelib::VPACK(1.0, 0.0, 1.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VPACK(1.0, 0.0, 1.0, XMAXP.as_slice_mut());
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMAXLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
spicelib::VEQU(P1.as_slice(), XMINP.as_slice_mut());
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMINLT = (spicelib::PI(ctx) / 6 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(
b"Tangent *miss* case: segment parallel to X-Y plane, Z>0, segment max Y < 0.",
ctx,
)?;
spicelib::VPACK(1.0, -2.0, 1.0, P1.as_slice_mut());
spicelib::VPACK(1.0, -SQ2, 1.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VEQU(P2.as_slice(), XMAXP.as_slice_mut());
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMAXLT = (spicelib::PI(ctx) / 6 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
spicelib::VEQU(P1.as_slice(), XMINP.as_slice_mut());
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMINLT = f64::asin((1.0 / f64::sqrt(6.0)));
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(b"P2 = 2 * P1", ctx)?;
spicelib::VPACK(SQ22, -SQ22, 1.0, P1.as_slice_mut());
spicelib::VSCL(2.0, P1.as_slice(), P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VSUB(P2.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
spicelib::UNORM(DIFF.as_slice(), DIR.as_slice_mut(), &mut MAG);
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MAXP.as_slice(),
XMAXP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MAXP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MINP.as_slice(),
XMINP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MINP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
XMAXLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
XMINLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(b"P2 = - P1", ctx)?;
spicelib::VPACK(SQ22, -SQ22, 1.0, P1.as_slice_mut());
spicelib::VMINUS(P1.as_slice(), P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VSUB(P2.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
spicelib::UNORM(DIFF.as_slice(), DIR.as_slice_mut(), &mut MAG);
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MAXP.as_slice(),
XMAXP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MAXP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MINP.as_slice(),
XMINP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MINP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
XMAXLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
XMINLT = -(spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(b"Segment is in X-Y plane.", ctx)?;
spicelib::VPACK(SQ22, -SQ22, 0.0, P1.as_slice_mut());
spicelib::VPACK(SQ22, SQ22, 0.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VSUB(P2.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
spicelib::UNORM(DIFF.as_slice(), DIR.as_slice_mut(), &mut MAG);
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MAXP.as_slice(),
XMAXP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MAXP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MINP.as_slice(),
XMINP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MINP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
XMAXLT = 0.0;
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
XMINLT = 0.0;
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(b"Segment is contained in +Z axis", ctx)?;
spicelib::VPACK(0.0, 0.0, 1.0, P2.as_slice_mut());
spicelib::VPACK(0.0, 0.0, 2.0, P1.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VSUB(P2.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
spicelib::UNORM(DIFF.as_slice(), DIR.as_slice_mut(), &mut MAG);
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MAXP.as_slice(),
XMAXP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MAXP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MINP.as_slice(),
XMINP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MINP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
XMAXLT = (spicelib::PI(ctx) / 2 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
XMINLT = (spicelib::PI(ctx) / 2 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(b"Segment is contained in -Z axis", ctx)?;
spicelib::VPACK(0.0, 0.0, -1.0, P1.as_slice_mut());
spicelib::VPACK(0.0, 0.0, -2.0, P2.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VSUB(P2.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
spicelib::UNORM(DIFF.as_slice(), DIR.as_slice_mut(), &mut MAG);
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MAXP.as_slice(),
XMAXP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MAXP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
spicelib::NPLNPT(
P1.as_slice(),
DIR.as_slice(),
MINP.as_slice(),
XMINP.as_slice_mut(),
&mut DIST,
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
testutil::CHCKSD(b"DIST", DIST, b"~", 0.0, TIGHT, OK, ctx)?;
spicelib::VSUB(MINP.as_slice(), P1.as_slice(), DIFF.as_slice_mut());
DP = spicelib::VDOT(DIFF.as_slice(), DIR.as_slice());
testutil::CHCKSD(b"DP", DP, b">", -VTIGHT, 0.0, OK, ctx)?;
testutil::CHCKSD(b"DP", DP, b"<", (MAG + VTIGHT), 0.0, OK, ctx)?;
XMAXLT = -(spicelib::PI(ctx) / 2 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
XMINLT = -(spicelib::PI(ctx) / 2 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(b"Segment intersects but is not contained in +Z axis", ctx)?;
spicelib::VPACK(1.0, 0.0, 1.0, P2.as_slice_mut());
spicelib::VPACK(-1.0, 0.0, 1.0, P1.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VPACK(0.0, 0.0, 1.0, XMAXP.as_slice_mut());
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
spicelib::VEQU(P1.as_slice(), XMINP.as_slice_mut());
if (MINP[1] > 0.0) {
XMINP[1] = -XMINP[1];
}
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMAXLT = (spicelib::PI(ctx) / 2 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
XMINLT = (spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
testutil::TCASE(b"Segment intersects but is not contained in -Z axis", ctx)?;
spicelib::VPACK(1.0, 0.0, -1.0, P2.as_slice_mut());
spicelib::VPACK(-1.0, 0.0, -1.0, P1.as_slice_mut());
spicelib::ZZSGLATX(
P1.as_slice(),
P2.as_slice(),
&mut MINLAT,
MINP.as_slice_mut(),
&mut MAXLAT,
MAXP.as_slice_mut(),
ctx,
)?;
testutil::CHCKXC(false, b" ", OK, ctx)?;
spicelib::VPACK(0.0, 0.0, -1.0, XMINP.as_slice_mut());
testutil::CHCKAD(
b"MINP",
MINP.as_slice(),
b"~~/",
XMINP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
spicelib::VEQU(P1.as_slice(), XMAXP.as_slice_mut());
if (MAXP[1] > 0.0) {
XMAXP[1] = -XMAXP[1];
}
testutil::CHCKAD(
b"MAXP",
MAXP.as_slice(),
b"~~/",
XMAXP.as_slice(),
3,
VTIGHT,
OK,
ctx,
)?;
XMINLT = -(spicelib::PI(ctx) / 2 as f64);
testutil::CHCKSD(b"MINLAT", MINLAT, b"~", XMINLT, VTIGHT, OK, ctx)?;
XMAXLT = -(spicelib::PI(ctx) / 4 as f64);
testutil::CHCKSD(b"MAXLAT", MAXLAT, b"~", XMAXLT, VTIGHT, OK, ctx)?;
testutil::T_SUCCESS(OK, ctx);
Ok(())
}