//
//  MPElementaryFunctionTerm.h
//  MathKit
//
//  Created by Kim Wittenburg on 11.10.14.
//  Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//

#import "MPTerm.h"


/*!
 @header
 This file contains the <code>MPElementaryFunction</code> class.
 */



@class MPElementaryFunctionTerm;


/*!
    @class      MPElementaryFunctionTerm
    @abstract   A <code>MPElementaryFunction</code> implements various
                mathematical functions that have a valid text representation.
 */
@interface MPElementaryFunctionTerm : MPTerm

/*!
    @method     initWithFunctionIdentifier:term:
    @abstract   Initializes a function term using the specified textual
                representation of the function and a term as its value.
 
    @param      function
                The textual representation of the function to use. Valid values
                are <code>"sin"</code>, <code>"cos"</code>, <code>"tan"</code>,
                <code>"asin"</code>, <code>"arcsin"</code>, <code>"acos"</code>,
                <code>"arccos"</code>, <code>"atan"</code>,
                <code>"arctan"</code>, <code>"log"</code>, <code>"lg"</code> and
                <code>"ln"</code>.
 
    @param      term
                The term that should be evaluated using <code>function</code>.
 
    @return     A new <code>MPElementaryFunctionTerm</code> instance.
 */
- (instancetype)initWithFunctionIdentifier:(NSString *)function
                                      term:(MPTerm *)term; /* designated initializer */


/*!
    @property   functionIdentifier
    @abstract   The identifier of the receiver.
 
    @discussion The identifier of a function is the string of letters it is
                mathematically defined of (e.g. <code>"sin"</code> for the sine
                function).
 */
@property (readonly, nonatomic, copy) NSString *functionIdentifier;


/*!
    @property   term
    @abstract   The receiver's term.
 
    @discussion Depending on the actual function the value of the
                <code>term</code> may be converted from radians into degrees.
 */
@property (readonly, nonatomic, strong) MPTerm *term;

@end