|
{
|
|
"HIGHLIGHTSTROKECOLORS": [
|
|
[
|
|
"maths",
|
|
"#000000"
|
|
]
|
|
],
|
|
"ARGPLUGINS": [
|
|
[
|
|
"power",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;var base = logo.parseArg(logo, turtle, conns[1]);var exp = logo.parseArg(logo, turtle, conns[2]);block.value = Math.pow(base, exp);"
|
|
],
|
|
[
|
|
"sin",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.sin(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"cos",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.cos(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"sin",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.tan(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"asin",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.asin(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"acos",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.acos(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"atan",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.atan(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"floor",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.floor(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"ceiling",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.ceil(logo.parseArg(logo, turtle, conns[1]));"
|
|
],
|
|
[
|
|
"degrees",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = logo.parseArg(logo, turtle, conns[1]) * (180/Math.PI);"
|
|
],
|
|
[
|
|
"radians",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = logo.parseArg(logo, turtle, conns[1]) * (Math.PI/180);"
|
|
],
|
|
[
|
|
"pi",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.PI;"
|
|
],
|
|
[
|
|
"e",
|
|
"var block = logo.blocks.blockList[blk];var conns = block.connections;block.value = Math.E;"
|
|
]
|
|
],
|
|
"PALETTEHIGHLIGHTCOLORS": [
|
|
[
|
|
"maths",
|
|
"#ffb1b3"
|
|
]
|
|
],
|
|
"PALETTEPLUGINS": [
|
|
[
|
|
"maths",
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><!-- Created with Inkscape (http://www.inkscape.org/) --><svg xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"55\" height=\"55\" viewBox=\"0 0 55 55\" id=\"svg2\" xml:space=\"preserve\"><metadata id=\"metadata13\"><rdf:RDF><cc:Work rdf:about=\"\"><dc:format>image/svg+xml</dc:format><dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs id=\"defs11\" /><g id=\"toolbar-trigonometry\" style=\"fill:#000000;display:block\"><path d=\"m 11.852704,38.123539 31.294591,0 -31.294591,-26.247077 z\" id=\"path5\" style=\"fill:none;stroke:#ffffff;stroke-width:3.53326035\" /><path d=\"m 11.852704,30.047514 8.076024,0 0,8.076025\" id=\"path7\" style=\"fill:none;stroke:#ffffff;stroke-width:1.51425433\" /></g></svg>"
|
|
]
|
|
],
|
|
"BLOCKPLUGINS": [
|
|
[
|
|
"power",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};var block = new ProtoBlock('power');block.palette = palettes.dict['maths'];blocks.protoBlockDict['power'] = block;block.staticLabels.push(_('power'), _('base'), _('exp'));block.twoArgMathBlock();block.defaults.push(10, 2);"
|
|
],
|
|
[
|
|
"sin",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock('sin');"
|
|
],
|
|
[
|
|
"cos",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock('cos');"
|
|
],
|
|
[
|
|
"tan",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock('tan');"
|
|
],
|
|
[
|
|
"asin",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock('asin');"
|
|
],
|
|
[
|
|
"acos",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock('acos');"
|
|
],
|
|
[
|
|
"atan",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock('atan');"
|
|
],
|
|
[
|
|
"floor",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock(_('floor'));"
|
|
],
|
|
[
|
|
"ceiling",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock(_('ceiling'));"
|
|
],
|
|
[
|
|
"degrees",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock(_('degrees'), _('to degrees'));"
|
|
],
|
|
[
|
|
"radians",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};simpleOneArgBlock(_('radians'), _('to radians'));"
|
|
],
|
|
[
|
|
"pi",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};staticBlock('pi', '\u03c0');"
|
|
],
|
|
[
|
|
"e",
|
|
"var simpleOneArgBlock = function (name, label) { if (label === undefined) { var label = name; } var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.oneArgMathBlock(); block.defaults.push(1);};var staticBlock = function (name, label) { var block = new ProtoBlock(name); block.palette = palettes.dict['maths']; blocks.protoBlockDict[name] = block; block.staticLabels.push(label); block.adjustWidthToLabel(); block.parameterBlock();};staticBlock('e', 'e');"
|
|
]
|
|
],
|
|
"PALETTEFILLCOLORS": [
|
|
[
|
|
"maths",
|
|
"#ff0066"
|
|
]
|
|
],
|
|
"PALETTESTROKECOLORS": [
|
|
[
|
|
"maths",
|
|
"#ef003e"
|
|
]
|
|
]
|
|
}
|