/*
FEMSuite - (C) 2018 Fady Kamel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Photonica is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FEMSuite. If not, see .
*/
#pragma once
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
#include "FEMSuiteCommondll.h"
#include "PolarVector.h"
namespace geometry
{
/// Gets the two other dimensions of the curl as well as the curl sign
void _DLL GetCrossProductDimensions( const size_t d, size_t& d2, size_t& d3, char& sign );
/// Gets the two other dimensions of the curl as well as the curl sign
void _DLL GetCrossProductDimensions( const size_t d, size_t& d2, size_t& d3 );
/// Performes a linear interpolation of a function between two known points
/// First known point
/// Point at which the function is to be estimated
/// Second known point
/// First known value
/// Second known value
double _DLL LinearInterpolation( const double x0, const double x1, const double x2, const double y0, const double y2 );
/// Computes the cross product of two points / cartesian vectors
/// First point
/// Second point
/// Cross product of both points
Point< Spatial> _DLL CrossProduct( const Point<>& p1, const Point<>& p2 );
/// Computes the dot product of two points / cartesian vectors
/// First point
/// Second point
/// Dot product of both points
Spatial _DLL DotProduct( const Point& p1, const Point& p2 );
/// Computes the vector normal to a given vector.
// TODO: along which axis?
DimensionArray< Spatial > _DLL norm( const DimensionArray< Spatial >& );
/// Computes the unrotated (i,j) coordinates of an ellipsoidal shape
/// Angle the radius makes with the i axis
/// Ellipsoidal attenuation constant
/// Returns std::pair( INF, INF ) when value cannot be computed.
std::pair _DLL EllipsoidalCoordinates( const Radian angle, const double aleph, const std::array& extents );
/// Computes the radius of an ellipsoidal shape
/// Angle the radius makes with the i axis
/// Ellipsoidal attenuation constant
Spatial _DLL EllipsoidalRadius( const Radian angle, const double aleph, const std::array& extents );
/// Computes the unrotated (i,j) coordinates of an elliptical shape
/// Angle the radius makes with the i axis
/// Returns std::pair( INF, INF ) when value cannot be computed.
std::pair _DLL EllipticalCoordinates( const Radian angle, const std::array& extents );
/// Computes the radius of an elliptical shape
/// Angle the radius makes with the i axis
Spatial _DLL EllipticalRadius( const Radian angle, const std::array& extents );
} // geometry