Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #611 from jiggzson/dev
Browse files Browse the repository at this point in the history
v 1.1.11
  • Loading branch information
jiggzson authored May 24, 2021
2 parents cbe3efb + 453c630 commit efd745b
Show file tree
Hide file tree
Showing 15 changed files with 5,993 additions and 6,004 deletions.
3,888 changes: 2,042 additions & 1,846 deletions Algebra.js

Large diffs are not rendered by default.

1,435 changes: 756 additions & 679 deletions Calculus.js

Large diffs are not rendered by default.

263 changes: 147 additions & 116 deletions Extra.js

Large diffs are not rendered by default.

753 changes: 427 additions & 326 deletions Solve.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions all.min.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');

var devFiles = ['./nerdamer.core.js','./Algebra.js', './Calculus.js', './Solve.js', './Extra.js'];

gulp.task('concat_all', function() {
return gulp.src(devFiles)
.pipe(concat('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./'));
});

gulp.task('watch', function() {
gulp.watch(devFiles, gulp.series('concat_all'));
});
145 changes: 133 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ return _.multiply(sum, product)
}
//register the function with nerdamer
nerdamer.register({
name: 'myFunction',
numargs: 2,
visible: true,
build: function(){ return f }
name: 'myFunction',
numargs: 2,
visible: true,
build: function(){ return f }
})
//create an alias for the diff function
var core = nerdamer.getCore()
nerdamer.register({
name: 'D',
visible: true,
numargs: [1, 3],
build: function(){ return core.Calculus.diff }
name: 'D',
visible: true,
numargs: [1, 3],
build: function(){ return core.Calculus.diff }
})
*/
export function register(f: ModuleFunction | ModuleFunction[]): typeof nerdamer
Expand Down Expand Up @@ -190,7 +190,7 @@ return _.multiply(sum, product)
* Generates a JavaScript function given the expression. This is perfect for plotting and filtering user input. Plotting for the demo is accomplished using this. The order of the parameters is in alphabetical order by default but an argument array can be provided with the desired order.
* @param args_array The argument array with the order in which they are preferred.
*/
buildFunction(args_array: string[]): (...args: number[]) => number
buildFunction(args_array?: string[]): (...args: number[]) => number

/**
* Forces evaluation of the expression.
Expand Down Expand Up @@ -220,6 +220,11 @@ return _.multiply(sum, product)
*/
toTeX(): string

/**
* Returns the value of the expression as a string or a number
*/
valueOf(): string | number

/**
* Gets the list of reserved names. This is a list of names already in use by nerdamer excluding variable names. This is not a static list.
* @param outputType Pass in the string 'decimals' to always get back numers as decimals. Pass in the string 'fractions' to always get back number as fractions. Defaults to decimals.
Expand All @@ -234,6 +239,122 @@ return _.multiply(sum, product)
* eq.solveFor('x') // ?? TODO
*/
solveFor(variable: string): Expression

/**
* Forces the expression to displayed with decimals
*/
toDecimal(prec?: number): string

/**
* Checks to see if the expression's value equals a number. Compares the direct value returned.
* The function will not check for all possible cases. To avoid this call evaluate.
* @example
* nerdamer('sqrt(5)').isNumber()
* // false
* nerdamer('sqrt(5)').evaluate().isNumber()
* // true
*/
isNumber(): boolean

/**
* Checks if a number evaluates to an imaginary number
* @example
* nerdamer('sqrt(-5)+8').isImaginary()
* // true
* nerdamer('sqrt(5)+8').isImaginary()
* // false
*/
isImaginary(): boolean

/**
* Adds a value to an expression
* @example
* nerdamer('x').add(3)
*/
add(symbol: number | string | Expression): Expression

/**
* Subtracts a value from an expression
* @example
* nerdamer('x').subtract(3)
*/
subtract(symbol: number | string | Expression): Expression

/**
* Multiplies an expression by a value
* @example
* nerdamer('x').multiply(3)
*/
multiply(symbol: number | string | Expression): Expression

/**
* Divides an expression by a valule
* @example
* nerdamer('9*x').divide(3)
*/
divide(symbol: number | string | Expression): Expression

/**
* Raises an expression to a power
* @example
* nerdamer('x').pow(3)
*/
pow(symbol: number | string | Expression): Expression

/**
* Checks if two values are equal
* @param value The value being tested
* @example
* nerdamer('sqrt(9)').eq(3)
* // true
* nerdamer('x').eq('y')
* // false
*/
eq(value: number | string | Expression): Expression

/**
* Checks if a value is less than another
* @param value The value being tested
* @example
* nerdamer('sqrt(9)').lt(3)
* // false
* nerdamer('8').lt(100)
* // true
*/
lt(value: number | string | Expression): Expression

/**
* Checks if a value is less than or equal to another
* @param value The value being tested
* @example
* nerdamer('sqrt(9)').lte(3)
* // true
* nerdamer('x').lte(100)
* // false
*/
lte(value: number | string | Expression): Expression

/**
* Checks if a value is greater than another
* @param value The value being tested
* @example
* nerdamer('sqrt(9)').gt(3)
* // false
* nerdamer('800').gt(100)
* // true
*/
gt(value: number | string | Expression): Expression

/**
* Checks if a value is greater than or equal to another
* @param value The value being tested
* @example
* nerdamer('sqrt(9)').gte(3)
* // true
* nerdamer('x').gte(100)
* // false
*/
gte(value: number | string | Expression): Expression
}

////////// CALCULUS
Expand All @@ -246,9 +367,9 @@ return _.multiply(sum, product)
* @param upper Ending index.
*/
export function sum(expression: ExpressionParam,
index: string,
lower: ExpressionParam,
upper: ExpressionParam): Expression
index: string,
lower: ExpressionParam,
upper: ExpressionParam): Expression

/**
*
Expand Down
Loading

0 comments on commit efd745b

Please sign in to comment.