forked from jonlee3/craut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
34 lines (25 loc) · 845 Bytes
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
/**
Given a c-string of length 3*ATOM_COORD_LENGTH containing the coordinates of a point,
returns the point as a Vector3f. Each point must be ATOM_COORD_LENGTH characters.
*/
Eigen::Vector3d string_to_vector3d(char* xyz_coords);
/**
Returns a string that is a copy of s but without any whitepsace characters
*/
std::string remove_whitespace(std::string s);
/**
Returns true iff the triangle inequality is sasified for a triangle
with side lengths a,b,c.
*/
bool triangle_ineq_satisfied(double a, double b, double c);
/**
Returns the angle C of a triangle with side lengths a,b,c.
Uses cosine law to find the angle
*/
double get_angle(double a, double b, double c);
/**
The probability density function of the gaussian distribution
*/
double gaussian(double x, double std_dev, double mean);
const double PI = 3.141592653589;