Kstars

SpatialConstraint.h
1#ifndef _SpatialConstraint_h
2#define _SpatialConstraint_h
3//# Filename: SpatialConstraint.h
4//#
5//# Classes defined here: SpatialConstraint SpatialSign
6//#
7//#
8//# Author: Peter Z. Kunszt, based on A. Szalay's code
9//#
10//# Date: October 16, 1998
11//#
12//# SPDX-FileCopyrightText: 2000 Peter Z. Kunszt Alex S. Szalay, Aniruddha R. Thakar
13//# The Johns Hopkins University
14//#
15//# Modification History:
16//#
17//# Oct 18, 2001 : Dennis C. Dinge -- Replaced ValVec with std::vector
18//#
19
20#include "SpatialGeneral.h"
21#include "SpatialSign.h"
22#include "SpatialVector.h"
23//
24//########################################################################
25//#
26//# Spatial Constraint class
27//#
28/**
29 The Constraint is really a cone on the sky-sphere. It is characterized
30 by its direction a_, the opening angle s_ and its cosine -- the distance
31 of the plane intersecting the sphere and the sphere center.
32 If d_ = 0, we have a half-sphere. If it is negative, we have a 'hole'
33 i.e. the room angle is larger than 90degrees.
34
35 Example: positive distance
36
37 ____
38 --- ---
39 / /|\
40 / / |=\
41 | / |==| this side is in the convex.
42 | /\s |===|
43 |------------|---| -> direction a
44 | \ |===|
45 | \ |==|
46 \ \ |=/
47 \ \|/
48 ---____---
49
50
51 <-d-> is positive (s < 90)
52
53 Example: negative distance
54
55 ____
56 ---====---
57 this side is /========/|\
58 in the /========/=| \
59 convex |==== s__/==| |
60 |===== / /===| |
61 dir. a <- |------------|---| 'hole' in the sphere
62 |========\===| |
63 |========\==| |
64 \========\=| /
65 \========\|/
66 ---____---
67
68
69 <-d-> is negative (s > 90)
70
71 for d=0 we have a half-sphere. Combining such, we get triangles, rectangles
72 etc on the sphere surface (pure ZERO convexes)
73
74*/
75class LINKAGE SpatialConstraint
76{
77 public:
78 /// Constructor
80
81 /// Initialization constructor
83
84 /// check whether a vector is inside this
85 bool contains(const SpatialVector v);
86
87 /// give back vector
88 SpatialVector &v() { return a_; }
89
90 private:
91 Sign sign_;
92 SpatialVector a_; // normal vector
93 float64 d_; // distance from origin
94 float64 s_; // cone angle in radians
95
96 friend class RangeConvex;
97};
98
99#endif
A spatial convex is composed of spatial constraints.
Definition RangeConvex.h:60
The Constraint is really a cone on the sky-sphere.
SpatialVector & v()
give back vector
SpatialConstraint()
Constructor.
SpatialVector is a 3D vector usually living on the surface of the sphere.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:59:52 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.