Kstars

SpatialConstraint.cpp
1//# Filename: SpatialConstraint.cpp
2//#
3//# The SpatialConstraint, SpatialSign
4//# classes are defined here.
5//#
6//# Author: Peter Z. Kunszt based on A. Szalay's code
7//#
8//# Date: October 23, 1998
9//#
10//# SPDX-FileCopyrightText: 2000 Peter Z. Kunszt Alex S. Szalay, Aniruddha R. Thakar
11//# The Johns Hopkins University
12//#
13//# Modification History:
14//#
15//# Oct 18, 2001 : Dennis C. Dinge -- Replaced ValVec with std::vector
16//#
17
18#include "SpatialConstraint.h"
19#include "SpatialException.h"
20
21// ===========================================================================
22//
23// Member functions for class SpatialConstraint
24//
25// ===========================================================================
26
27/////////////CONSTRUCTOR//////////////////////////////////
28//
30{
31 a_.normalize();
32 s_ = acos(d_);
33 if (d_ <= -gEpsilon)
34 sign_ = nEG;
35 if (d_ >= gEpsilon)
36 sign_ = pOS;
37}
38
39/////////////CONTAINS/////////////////////////////////////
40// check whether a vector is inside this
41//
43{
44 return acos(v * a_) < s_;
45}
SpatialVector & v()
give back vector
bool contains(const SpatialVector v)
check whether a vector is inside this
SpatialConstraint()
Constructor.
SpatialVector is a 3D vector usually living on the surface of the sphere.
void normalize()
Normalize vector length to 1.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.