Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALHexagonVertices.c File Reference

Module to find the vertices of an hexagon inscribed in an ellipse given its centre, half side-lengths and orientation angle. More...

Prototypes

void LALHexagonVertices (LALStatus *status, HexagonOut *out, RectangleIn *in)
 

Detailed Description

Module to find the vertices of an hexagon inscribed in an ellipse given its centre, half side-lengths and orientation angle.

Author
Cokelaer Thomas.

Prototypes

LALHexagonVertices()

  • out, Output.
  • in, Input.

Description

This code computes the vertices of an hexagon for plotting a grid of templates with xmgr, useful when looking at the minimal-match-Hexagons around mesh points in a template bank. Used by SpaceCovering in the test directory.

Algorithm

Given the centre \((x_0,y_0)\) and half-sides \((dx,dy),\) the vertices of a Hexagon in a diagonal coordinate system are given by

\begin{eqnarray} x_1 & = & x_0 - dx, \quad y_1 = y_0 - dy, \\ x_2 & = & x_0 + dx, \quad y_2 = y_0 - dy, \\ x_3 & = & x_0 + dx, \quad y_3 = y_0 + dy, \\ x_4 & = & x_0 - dx, \quad y_4 = y_0 + dy. \end{eqnarray}

The coordinates of a Hexagon oriented at an angle \(\theta\) is found by using the formulas

\begin{eqnarray} x' = x \cos(\theta) - y \sin(\theta), \\ y' = y \cos(\theta) + x \sin(\theta). \end{eqnarray}

The function returns 7 coordinate points (1,2,3,4,5,6,1), and not just the 6 verticies, to help a plotting programme to complete the Hexagon.

Uses

None.

Notes

Definition in file LALHexagonVertices.c.

Go to the source code of this file.