• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • htmesh
SpatialConstraint.cpp
Go to the documentation of this file.
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 //# Copyright (C) 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 
28 //
29 SpatialConstraint::SpatialConstraint(SpatialVector a, float64 d) :
30  a_(a), d_(d)
31 {
32  a_.normalize();
33  s_ = acos(d_);
34  if(d_ <= -gEpsilon)
35  sign_ = nEG;
36  if(d_ >= gEpsilon)
37  sign_ = pOS;
38 }
39 
41 // check whether a vector is inside this
42 //
43 bool SpatialConstraint::contains(const SpatialVector v) {
44  return acos(v * a_) < s_;
45 }
SpatialConstraint::contains
bool contains(const SpatialVector v)
check whether a vector is inside this
Definition: SpatialConstraint.cpp:43
SpatialConstraint::SpatialConstraint
SpatialConstraint()
Constructor.
Definition: SpatialConstraint.h:79
gEpsilon
const float64 gEpsilon
Definition: SpatialGeneral.h:88
SpatialVector
The SpatialVector is a 3D vector usually living on the surface of the sphere.
Definition: SpatialVector.h:32
nEG
Definition: SpatialSign.h:9
NaN::d
const double d
Definition: nan.h:35
pOS
All constraints zero.
Definition: SpatialSign.h:11
SpatialConstraint.h
SpatialException.h
float64
double float64
Definition: SpatialGeneral.h:58
SpatialVector::normalize
void normalize()
Normalize vector length to 1.
Definition: SpatialVector.cpp:110
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal