Skip to content

Commit

Permalink
updating Energy.h
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanZurrin committed Mar 22, 2022
1 parent 9b3b3ed commit 1e2198c
Show file tree
Hide file tree
Showing 172 changed files with 84,958 additions and 39,212 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Project exclude paths
# Project exclude paths
/cmake-build-debug/
16 changes: 8 additions & 8 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/PhysicsFormula.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 65 additions & 65 deletions Angle.cpp
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
//
// Created by Ryan.Zurrin001 on 12/16/2021.
//
#include <cmath>

#include "Angle.h"

//float rez::AngleLines2D( const Line2d& l1, const Line2d l2)
//{
// auto mag_l1 = l1.direction().magnitude();
// auto mag_l2 = l2.direction().magnitude();
// auto dot = dotProduct(l1.direction(), l2.direction());
//
// auto theta = acos( fabs(dot) / (mag_l1 * mag_l2));
// return RadianceToDegrees(theta);
//}

//float rez::AngleLines3D(const Line& l1, const Line& l2)
//{
// auto mag_l1 = l1.direction().magnitude();
// auto mag_l2 = l2.direction().magnitude();
// auto dot = dotProduct(l1.direction(), l2.direction());
//
// auto theta = acos(fabs(dot) / (mag_l1 * mag_l2));
// return RadianceToDegrees(theta);
//}

//float rez::AngleLinePlane(const Line& l, const Planef p)
//{
// auto dot = dotProduct(l.direction(), p.getNormal());
// auto theta = acos(fabs(dot));
// theta = RadianceToDegrees(theta);
// return 90- theta;
//}

using namespace rez;

template<class T, size_t dimensions >
static float getAngle(rez::Vector<T, dimensions> v1, rez::Vector<T, dimensions> v2)
{
auto dot = dotProduct(v1, v2);
auto theta = acos(fabs(dot));
return RadianceToDegrees(theta);
}

float rez::AngleLines2D(const Line2d& l1, const Line2d l2)
{
return getAngle(l1.direction(), l2.direction());
}

float rez::AngleLines3D(const Line& l1, const Line& l2)
{
return getAngle(l1.direction(), l2.direction());
}

float rez::AngleLinePlane(const Line& l, const Planef p)
{
auto theta = getAngle(l.direction(), p.getNormal());
return 90 - theta;
}

float rez::AnglePlanes(const Planef p1, const Planef p2)
{
return getAngle(p1.getNormal(), p2.getNormal());
}
//
// Created by Ryan.Zurrin001 on 12/16/2021.
//
#include <cmath>

#include "Angle.h"

//float rez::AngleLines2D( const Line2d& l1, const Line2d l2)
//{
// auto mag_l1 = l1.direction().magnitude();
// auto mag_l2 = l2.direction().magnitude();
// auto dot = dotProduct(l1.direction(), l2.direction());
//
// auto theta = acos( fabs(dot) / (mag_l1 * mag_l2));
// return RadianceToDegrees(theta);
//}

//float rez::AngleLines3D(const Line& l1, const Line& l2)
//{
// auto mag_l1 = l1.direction().magnitude();
// auto mag_l2 = l2.direction().magnitude();
// auto dot = dotProduct(l1.direction(), l2.direction());
//
// auto theta = acos(fabs(dot) / (mag_l1 * mag_l2));
// return RadianceToDegrees(theta);
//}

//float rez::AngleLinePlane(const Line& l, const Planef p)
//{
// auto dot = dotProduct(l.direction(), p.getNormal());
// auto theta = acos(fabs(dot));
// theta = RadianceToDegrees(theta);
// return 90- theta;
//}

using namespace rez;

template<class T, size_t dimensions >
static float getAngle(rez::Vector<T, dimensions> v1, rez::Vector<T, dimensions> v2)
{
auto dot = dotProduct(v1, v2);
auto theta = acos(fabs(dot));
return RadianceToDegrees(theta);
}

float rez::AngleLines2D(const Line2d& l1, const Line2d l2)
{
return getAngle(l1.direction(), l2.direction());
}

float rez::AngleLines3D(const Line& l1, const Line& l2)
{
return getAngle(l1.direction(), l2.direction());
}

float rez::AngleLinePlane(const Line& l, const Planef p)
{
auto theta = getAngle(l.direction(), p.getNormal());
return 90 - theta;
}

float rez::AnglePlanes(const Planef p1, const Planef p2)
{
return getAngle(p1.getNormal(), p2.getNormal());
}
38 changes: 19 additions & 19 deletions Angle.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//
// Created by Ryan.Zurrin001 on 12/15/2021.
//

#ifndef PHYSICSFORMULA_ANGLE_H
#define PHYSICSFORMULA_ANGLE_H
#include "Line.h"
#include "Plane.h"

namespace rez {
float AngleLines2D(const Line2d& l1, const Line2d l2);

float AngleLines3D(const Line& l1, const Line& l2);

float AngleLinePlane(const Line& l, const Planef p);

float AnglePlanes(const Planef p1, const Planef p2);
};
#endif //PHYSICSFORMULA_ANGLE_H
//
// Created by Ryan.Zurrin001 on 12/15/2021.
//

#ifndef PHYSICSFORMULA_ANGLE_H
#define PHYSICSFORMULA_ANGLE_H
#include "Line.h"
#include "Plane.h"

namespace rez {
float AngleLines2D(const Line2d& l1, const Line2d l2);

float AngleLines3D(const Line& l1, const Line& l2);

float AngleLinePlane(const Line& l, const Planef p);

float AnglePlanes(const Planef p1, const Planef p2);
};
#endif //PHYSICSFORMULA_ANGLE_H
Loading

0 comments on commit 1e2198c

Please sign in to comment.