components/blockly-src/blocks/math.js
function() {
    this.jsonInit({
      "message0": "%1 %2",
      "args0": [
        {
          "type": "field_dropdown",
          "name": "OP",
          "options": [
            [Blockly.Msg.MATH_TRIG_SIN, 'SIN'],
            [Blockly.Msg.MATH_TRIG_COS, 'COS'],
            [Blockly.Msg.MATH_TRIG_TAN, 'TAN'],
            [Blockly.Msg.MATH_TRIG_ASIN, 'ASIN'],
            [Blockly.Msg.MATH_TRIG_ACOS, 'ACOS'],
            [Blockly.Msg.MATH_TRIG_ATAN, 'ATAN']
          ]
        },
        {
          "type": "input_value",
          "name": "NUM",
          "check": "Number"
        }
      ],
      "output": "Number",
      "colour": Blockly.Blocks.math.HUE,
      "helpUrl": Blockly.Msg.MATH_TRIG_HELPURL
    });
    // Assign 'this' to a variable for use in the tooltip closure below.
    var thisBlock = this;
    this.setTooltip(function() {
      var mode = thisBlock.getFieldValue('OP');
      var TOOLTIPS = {
        'SIN': Blockly.Msg.MATH_TRIG_TOOLTIP_SIN,
        'COS': Blockly.Msg.MATH_TRIG_TOOLTIP_COS,
        'TAN': Blockly.Msg.MATH_TRIG_TOOLTIP_TAN,
        'ASIN': Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN,
        'ACOS': Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS,
        'ATAN': Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN
      };
      return TOOLTIPS[mode];
    });
  }
function() {
    this.jsonInit({
      "message0": "%1 %2",
      "args0": [
        {
          "type": "field_dropdown",
          "name": "OP",
          "options": [
            [Blockly.Msg.MATH_TRIG_SIN, 'SIN'],
            [Blockly.Msg.MATH_TRIG_COS, 'COS'],
            [Blockly.Msg.MATH_TRIG_TAN, 'TAN'],
            [Blockly.Msg.MATH_TRIG_ASIN, 'ASIN'],
            [Blockly.Msg.MATH_TRIG_ACOS, 'ACOS'],
            [Blockly.Msg.MATH_TRIG_ATAN, 'ATAN']
          ]
        },
        {
          "type": "input_value",
          "name": "NUM",
          "check": "Number"
        }
      ],
      "output": "Number",
      "colour": Blockly.Blocks.math.HUE,
      "helpUrl": Blockly.Msg.MATH_TRIG_HELPURL
    });
    // Assign 'this' to a variable for use in the tooltip closure below.
    var thisBlock = this;
    this.setTooltip(function() {
      var mode = thisBlock.getFieldValue('OP');
      var TOOLTIPS = {
        'SIN': Blockly.Msg.MATH_TRIG_TOOLTIP_SIN,
        'COS': Blockly.Msg.MATH_TRIG_TOOLTIP_COS,
        'TAN': Blockly.Msg.MATH_TRIG_TOOLTIP_TAN,
        'ASIN': Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN,
        'ACOS': Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS,
        'ATAN': Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN
      };
      return TOOLTIPS[mode];
    });
  }
function ( ) { this . jsonInit ( { "message0" : "%1 %2" , "args0" : [ { "type" : "field_dropdown" , "name" : "OP" , "options" : [ [ Blockly . Msg . MATH_TRIG_SIN , 'SIN' ] , [ Blockly . Msg . MATH_TRIG_COS , 'COS' ] , [ Blockly . Msg . MATH_TRIG_TAN , 'TAN' ] , [ Blockly . Msg . MATH_TRIG_ASIN , 'ASIN' ] , [ Blockly . Msg . MATH_TRIG_ACOS , 'ACOS' ] , [ Blockly . Msg . MATH_TRIG_ATAN , 'ATAN' ] ] } , { "type" : "input_value" , "name" : "NUM" , "check" : "Number" } ] , "output" : "Number" , "colour" : Blockly . Blocks . math . HUE , "helpUrl" : Blockly . Msg . MATH_TRIG_HELPURL } ) ; // Assign 'this' to a variable for use in the tooltip closure below. var thisBlock = this ; this . setTooltip ( function ( ) { var mode = thisBlock . getFieldValue ( 'OP' ) ; var TOOLTIPS = { 'SIN' : Blockly . Msg . MATH_TRIG_TOOLTIP_SIN , 'COS' : Blockly . Msg . MATH_TRIG_TOOLTIP_COS , 'TAN' : Blockly . Msg . MATH_TRIG_TOOLTIP_TAN , 'ASIN' : Blockly . Msg . MATH_TRIG_TOOLTIP_ASIN , 'ACOS' : Blockly . Msg . MATH_TRIG_TOOLTIP_ACOS , 'ATAN' : Blockly . Msg . MATH_TRIG_TOOLTIP_ATAN } ; return TOOLTIPS [ mode ] ; } ) ; }
Block for trigonometry operators.
@this Blockly.Block
Block for trigonometry operators .