casacore
Loading...
Searching...
No Matches
Geometry.h
Go to the documentation of this file.
1//# Copyright (C) 2010 by ESO (in the framework of the ALMA collaboration)
2//# Copyright (C) 1996,1997,1998,1999,2000,2001
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26#ifndef SCIMATH_GEOMETRY_H
27#define SCIMATH_GEOMETRY_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Quanta/Quantum.h>
31#include <utility>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Geometry related methods.
37// </summary>
38
39// <use visibility=export>
40
41//# <author>Dave Mehringer</author>
42// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
43// </reviewed>
44// <etymology>
45// self-explanatory
46// </etymology>
47
48// <synopsis>
49// Various geometry related functions
50// </synopsis>
51
52// <motivation>
53// Commonly used geometrical functions for various image and region
54// applications.
55// </motivation>
56
57class Geometry {
58
59public:
60
61 // Get result of rotating a 2-D vector counterclockwise through an angle
62 // <src>theta</src>. The output pair will have x as the first
63 // member and y as the second. <src>theta</src> must have angular units (no explicit
64 // checking is done, but an exception will be thrown from the Quanta code if not).
65 static std::pair<Double, Double> rotate2D(
66 Double x, Double y, const Quantity& theta
67 );
68
69 // Determine if two coplanar line segments, a and b, intersect. Line segment a
70 // has end points a0 and a1, and line segment b has endpoints b0 and b1.
71 // Algorithm from
72 // http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect
74 Double a0x, Double a0y, Double a1x, Double a1y,
75 Double b0x, Double b0y, Double b1x, Double b1y
76 );
77
78};
79} //# NAMESPACE CASACORE - END
80
81#endif
82
static std::pair< Double, Double > rotate2D(Double x, Double y, const Quantity &theta)
Get result of rotating a 2-D vector counterclockwise through an angle theta.
static Bool doLineSegmentsIntersect(Double a0x, Double a0y, Double a1x, Double a1y, Double b0x, Double b0y, Double b1x, Double b1y)
Determine if two coplanar line segments, a and b, intersect.
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53