11import { linspace , sgn , infinity , clamp , space , isValidNumber } from '../utils.mjs'
2- import { builtIn as evaluate } from './eval.mjs'
2+ import { builtIn as builtInEvaluate } from './eval.mjs'
33
44import type { FunctionPlotDatum , FunctionPlotScale , PointFunction , VectorFunction } from '../types.js'
55import type { SamplerParams , SamplerFn , BuiltInSamplerResult , BuiltInSamplerResultGroup } from './types.js'
@@ -27,7 +27,7 @@ function checkAsymptote(
2727 let oldY : number , oldX : number
2828 for ( let i = 0 ; i < n ; i += 1 ) {
2929 const x = samples [ i ]
30- const y = evaluate ( d , 'fn' , { x } )
30+ const y = builtInEvaluate ( d , 'fn' , { x } )
3131
3232 if ( oldY ) {
3333 const deltaY = y - oldY
@@ -122,7 +122,7 @@ function linear(samplerParams: SamplerParams): BuiltInSamplerResult {
122122 const data : Array < [ number , number ] > = [ ]
123123 for ( let i = 0 ; i < allX . length ; i += 1 ) {
124124 const x = allX [ i ]
125- let y = evaluate ( samplerParams . d , 'fn' , { x } )
125+ let y = builtInEvaluate ( samplerParams . d , 'fn' , { x } )
126126 if ( isValidNumber ( x ) && isValidNumber ( y ) ) {
127127 y = clamp ( y , yMin , yMax )
128128 data . push ( [ x , y ] )
@@ -140,8 +140,8 @@ function parametric(samplerParams: SamplerParams): BuiltInSamplerResult {
140140 const samples : BuiltInSamplerResultGroup = [ ]
141141 for ( let i = 0 ; i < tCoords . length ; i += 1 ) {
142142 const t = tCoords [ i ]
143- const x = evaluate ( samplerParams . d , 'x' , { t } )
144- const y = evaluate ( samplerParams . d , 'y' , { t } )
143+ const x = builtInEvaluate ( samplerParams . d , 'x' , { t } )
144+ const y = builtInEvaluate ( samplerParams . d , 'y' , { t } )
145145 samples . push ( [ x , y ] )
146146 }
147147 return [ samples ]
@@ -155,7 +155,7 @@ function polar(samplerParams: SamplerParams): BuiltInSamplerResult {
155155 const samples : BuiltInSamplerResultGroup = [ ]
156156 for ( let i = 0 ; i < thetaSamples . length ; i += 1 ) {
157157 const theta = thetaSamples [ i ]
158- const r = evaluate ( samplerParams . d , 'r' , { theta } )
158+ const r = builtInEvaluate ( samplerParams . d , 'r' , { theta } )
159159 const x = r * Math . cos ( theta )
160160 const y = r * Math . sin ( theta )
161161 samples . push ( [ x , y ] )
0 commit comments