ee.Number.sin

Computes the sine of the input in radians.

UsageReturns
Number.sin()Number
ArgumentTypeDetails
this: inputNumber

The input value.

Examples

JavaScript

// Examples using the sin() math function.
print(ee.Number(-Math.PI).sin());  // Almost 0.0
print(ee.Number(0).sin());  // 0
print(ee.Number(Math.PI / 2.0).sin());  // 1
print(ee.Number(Math.PI).sin());  // Almost 0.0

// Define a sequence from -2pi to +2pi in 50 increments.
var start = -2 * Math.PI;
var end = 2 * Math.PI;
var points = ee.List.sequence(start, end, null, 50);

// Evaluate the sin() function for each value in the `points` sequence.
var values = points.map(function(val) {
  return ee.Number(val).sin();
});

// Evaluate and plot the equations defined above.
var chart = ui.Chart.array.values(values, 0, points)
    .setOptions({
      viewWindow: {min: start, max: end},
      hAxis: {
        title: 'radians',
        viewWindowMode: 'maximized',
        ticks: [
          {v: start, f: '-2π'},
          {v: -Math.PI, f: '-π'},
          {v: 0, f: '0'},
          {v: Math.PI, f: 'π'},
          {v: end, f: '2π'}]
      },
      vAxis: {title: 'sin(x)'},
      lineWidth: 1,
      pointSize: 3,
    });
print(chart);

Python

# Your example goes here!