Add Root Function and Product Function
This commit is contained in:
8
MathKit/MPFunctionsViewController.m
Normal file → Executable file
8
MathKit/MPFunctionsViewController.m
Normal file → Executable file
@@ -10,9 +10,11 @@
|
||||
|
||||
#import "MPFunction.h"
|
||||
#import "MPFractionFunction.h"
|
||||
#import "MPRootFunction.h"
|
||||
#import "MPParenthesisFunction.h"
|
||||
#import "MPPowerFunction.h"
|
||||
#import "MPSumFunction.h"
|
||||
#import "MPProductFunction.h"
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
@@ -224,16 +226,20 @@ static void *MPFunctionTemplateViewMouseOverContext = @"MPFunctionTemplateViewMo
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
MPFunction *sumFunction = [[MPSumFunction alloc] init];
|
||||
MPFunction *productFunction = [[MPProductFunction alloc] init];
|
||||
MPFunction *parenthesisFunction = [[MPParenthesisFunction alloc] init];
|
||||
MPFunction *powerFunction = [[MPPowerFunction alloc] init];
|
||||
MPPowerFunction *squareFunction = [[MPPowerFunction alloc] init];
|
||||
squareFunction.exponentExpression = [[MPExpression alloc] initWithElement:@"2"];
|
||||
MPPowerFunction *cubicFunction = [[MPPowerFunction alloc] init];
|
||||
cubicFunction.exponentExpression = [[MPExpression alloc] initWithElement:@"3"];
|
||||
MPFunction *rootFunction = [[MPRootFunction alloc] init];
|
||||
MPFractionFunction *fractionFunction = [[MPFractionFunction alloc] init];
|
||||
self.functionPrototypes = @[
|
||||
@{@"function": sumFunction,
|
||||
@"name": NSLocalizedString(@"Sum", @"Sum Function Name")},
|
||||
@{@"function": productFunction,
|
||||
@"name": NSLocalizedString(@"Product", @"Product Function Name")},
|
||||
@{@"function": parenthesisFunction,
|
||||
@"name": NSLocalizedString(@"Parenthesis", @"Parenthesis Function Name")},
|
||||
@{@"function": squareFunction,
|
||||
@@ -242,6 +248,8 @@ static void *MPFunctionTemplateViewMouseOverContext = @"MPFunctionTemplateViewMo
|
||||
@"name": NSLocalizedString(@"Cubic", @"Cubic Function Name")},
|
||||
@{@"function": powerFunction,
|
||||
@"name": NSLocalizedString(@"Power", @"Power Function Name")},
|
||||
@{@"function": rootFunction,
|
||||
@"name": NSLocalizedString(@"Root", "Root Function Name")},
|
||||
@{@"function": fractionFunction,
|
||||
@"name": NSLocalizedString(@"Fraction", @"Fraction Function Name")}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user