PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
transformation.h
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2024 Prashant K. Jha
4 * -------------------------------------------
5 * PeriDEM https://github.com/prashjha/PeriDEM
6 *
7 * Distributed under the Boost Software License, Version 1.0. (See accompanying
8 * file LICENSE)
9 */
10
11#ifndef UTIL_TRANSFORMATION_H
12#define UTIL_TRANSFORMATION_H
13
14#include "point.h" // definition of Point
15#include <vector>
16
17namespace util {
18
30std::vector<double> rotateCW2D(const std::vector<double> &x,
31 const double &theta);
32
39util::Point rotateCW2D(const util::Point &x, const double &theta);
40
47std::vector<double> rotateACW2D(const std::vector<double> &x,
48 const double &theta);
49
56util::Point rotateACW2D(const util::Point &x, const double &theta);
57
64std::vector<double> rotate2D(const std::vector<double> &x, const double &theta);
65
72util::Point rotate2D(const util::Point &x, const double &theta);
73
83util::Point derRotate2D(const util::Point &x, const double &theta);
84
93util::Point rotate(const util::Point &p, const double &theta, const util::Point &axis);
94
101double angle(util::Point a, util::Point b);
102
112double angle(util::Point a, util::Point b, util::Point axis, bool is_axis = true);
113
116} // namespace util
117
118#endif // UTIL_TRANSFORMATION_H
Collection of methods useful in simulation.
std::vector< double > rotate2D(const std::vector< double > &x, const double &theta)
Rotates a vector in xy-plane assuming ACW convention.
double angle(util::Point a, util::Point b)
Computes angle between two vectors.
util::Point derRotate2D(const util::Point &x, const double &theta)
Computes derivative of rotation wrt to time.
std::vector< double > rotateACW2D(const std::vector< double > &x, const double &theta)
Rotates a vector in xy-plane in anti-clockwise direction.
std::vector< double > rotateCW2D(const std::vector< double > &x, const double &theta)
Rotates a vector in xy-plane in clockwise direction.
util::Point rotate(const util::Point &p, const double &theta, const util::Point &axis)
Returns the vector after rotating by desired angle.
A structure to represent 3d vectors.
Definition point.h:30