-
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.
🔖 λcommon v1.6.11: More maths methods, and C wrapping.
- Loading branch information
1 parent
7cce919
commit 9a3c33b
Showing
13 changed files
with
278 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,8 @@ | |
# define CLAMBDA_CYGWIN | ||
#endif | ||
|
||
#include "maths.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
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,38 @@ | ||
/* | ||
* Copyright © 2018 AperLambda <aperlambda@gmail.com> | ||
* | ||
* This file is part of λcommon. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
*/ | ||
|
||
#ifndef CLAMBDACOMMON_MATHS_H | ||
#define CLAMBDACOMMON_MATHS_H | ||
|
||
#define LCOMMON_PI 3.14159265359 | ||
|
||
// Define every functions that include templates as preprocessor defines. | ||
#define lcommon_maths_abs(number) (number < 0 ? -(number) : number) | ||
#define lcommon_maths_min(a, b) (a < b ? a : b) | ||
#define lcommon_maths_max(a, b) (a > b ? a : b) | ||
#define lcommon_maths_clamp(number, min, max) lcommon_maths_min(lcommon_maths_max(number, min), max) //maths::min(maths::max(number, min), max) | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
double lcommon_maths_radians(double degrees); | ||
|
||
float lcommon_maths_fradians(float degrees); | ||
|
||
double lcommon_maths_degrees(double radians); | ||
|
||
float lcommon_maths_fdegrees(float radians); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif //CLAMBDACOMMON_MATHS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright © 2018 AperLambda <aperlambda@gmail.com> | ||
* | ||
* This file is part of λcommon. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
*/ | ||
|
||
#include "../include/clambdacommon/maths.h" | ||
#include <lambdacommon/maths.h> | ||
|
||
double lcommon_maths_radians(double degrees) | ||
{ | ||
return lambdacommon::maths::degrees(degrees); | ||
} | ||
|
||
float lcommon_maths_fradians(float degrees) | ||
{ | ||
return lambdacommon::maths::degrees(degrees); | ||
} | ||
|
||
double lcommon_maths_degrees(double radians) | ||
{ | ||
return lambdacommon::maths::radians(radians); | ||
} | ||
|
||
float lcommon_maths_fdegrees(float radians) | ||
{ | ||
return lambdacommon::maths::radians(radians); | ||
} |
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
Oops, something went wrong.