-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from taiga-project/186-release-quadratic-bezier
Add Bezier
- Loading branch information
Showing
15 changed files
with
127 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "test_bezier.h" | ||
#include "taiga_test.h" | ||
#include "utils/taiga_constants.h" | ||
#define __device__ ; | ||
#include "core/maths/maths.cu" | ||
|
||
double get_bezier(double X_prev[6], double X[6], double detector[4], double timestep, int index){ | ||
interpolate_bezier(X_prev, X, detector, timestep); | ||
return X[index]; | ||
} | ||
|
||
int test_bezier() { | ||
TAIGA_INIT_TEST("BEZIER"); | ||
|
||
double X_prev[6] = {-1, 1, 0, sqrt(2), sqrt(2), 0}; | ||
double X[6] = {2, 0, 0, 0, -1, 0}; | ||
double D[4] = {1, 0, 0, -1}; | ||
TAIGA_ASSERT_ALMOST_EQ(1, get_bezier(X_prev, X, D, 1, 0), "x @ x=1 vs x^2+y^2=4"); | ||
|
||
double X2_prev[6] = {0, sqrt(3), 0, sqrt(3), 1, 0}; | ||
double X2[6] = {2, sqrt(3), 0, sqrt(3), -1, 0}; | ||
TAIGA_ASSERT_ALMOST_EQ(1, get_bezier(X2_prev, X2, D, 1, 0), "x @ x=1 vs (x-1)^2+y^2=4"); | ||
|
||
double X3_prev[6] = {1, 2, 0, 1, 1, 0}; | ||
double X3[6] = {2, 1, 0, 1, -1, 0}; | ||
double D3[4] = {1.0, 1.0, 0, -1.0}; | ||
TAIGA_ASSERT_ALMOST_EQ(2, get_bezier(X3_prev, X3, D3, 1, 0), "x @ x=1 vs (x-1)^2+y^2=4"); | ||
TAIGA_ASSERT_ALMOST_EQ(1, get_bezier(X3_prev, X3, D3, 1, 1), "y @ x=1 vs (x-1)^2+y^2=4"); | ||
|
||
|
||
return TAIGA_ASSERT_SUMMARY(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef TEST_INTERPOLATE_H | ||
#define TEST_INTERPOLATE_H | ||
|
||
int test_bezier(); | ||
|
||
#endif //TEST_INTERPOLATE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters