summaryrefslogtreecommitdiff
path: root/platform/darwin/src/NSExpression+MGLAdditions.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/NSExpression+MGLAdditions.mm')
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm
index 8c79fd43f8..e641c79628 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.mm
+++ b/platform/darwin/src/NSExpression+MGLAdditions.mm
@@ -73,6 +73,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier =
INSTALL_METHOD(mgl_asin:);
INSTALL_METHOD(mgl_sin:);
INSTALL_METHOD(mgl_atan:);
+ INSTALL_METHOD(mgl_tan:);
// Install functions that resemble control structures, taking arbitrary
// numbers of arguments. Vararg aftermarket functions need to be declared
@@ -138,6 +139,13 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier =
}
/**
+ Computes the principal value of the tangent.
+ */
+- (NSNumber *)mgl_tan:(NSNumber *)number {
+ return @(tan(number.doubleValue));
+}
+
+/**
A placeholder for a method that evaluates an interpolation expression.
*/
- (id)mgl_interpolate:(id)inputExpression withCurveType:(NSString *)curveType parameters:(NSDictionary *)params stops:(NSDictionary *)stops {
@@ -720,6 +728,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
@"asin" : @"mgl_asin:",
@"sin" : @"mgl_sin:",
@"atan" : @"mgl_atan:",
+ @"tan" : @"mgl_tan:",
@"floor": @"floor:",
@"ceil": @"ceiling:",
@"^": @"raise:toPower:",
@@ -967,6 +976,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
@"mgl_asin:" : @"asin",
@"mgl_sin:" : @"sin",
@"mgl_atan:" : @"atan",
+ @"mgl_tan:" : @"tan",
// Vararg aftermarket expressions need to be declared with an explicit and implicit first argument.
@"MGL_LET": @"let",
@"MGL_LET:": @"let",