added hyperdyadic ATAN2 primitive reachable via "relabel"

pull/95/head
jmoenig 2020-12-09 11:24:22 +01:00
rodzic 55e86b60fa
commit d9839968ea
4 zmienionych plików z 37 dodań i 15 usunięć

Wyświetl plik

@ -6,6 +6,7 @@
* raycasting: new "ray length" option in the "relation TO object" primitive
* hyperdyadic MIN and MAX primitives reachable via "relabel"
* hyperdyadic less / great than or equals primitives reachable via "relabel"
* hyperdyadic ATAN2 primitive reachable via "relabel"
* new SIGN function in arithmetic dropdown
* **Notable Changes:**
* searching for blocks and keyboard entry now includes the contents of dropdown menus
@ -23,6 +24,7 @@
### 2020-12-09
* Tamil translation update, thanks, Barthdry!
* threads, objects: added hyperdyadic ATAN2 primitive reachable via "relabel"
### 2020-12-07
* GUI: improved SVG loading, thanks, Joan!

Wyświetl plik

@ -9,8 +9,8 @@
<script src="src/symbols.js?version=2020-10-07"></script>
<script src="src/widgets.js?version=2020-10-06"></script>
<script src="src/blocks.js?version=2020-12-07"></script>
<script src="src/threads.js?version=2020-12-07"></script>
<script src="src/objects.js?version=2020-12-07"></script>
<script src="src/threads.js?version=2020-12-09"></script>
<script src="src/objects.js?version=2020-12-09"></script>
<script src="src/gui.js?version=2020-12-07"></script>
<script src="src/paint.js?version=2020-05-17"></script>
<script src="src/lists.js?version=2020-12-01"></script>

Wyświetl plik

@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph,
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows*/
modules.objects = '2020-December-07';
modules.objects = '2020-December-09';
var SpriteMorph;
var StageMorph;
@ -1106,6 +1106,11 @@ SpriteMorph.prototype.initBlocks = function () {
category: 'operators',
spec: '%n mod %n'
},
reportAtan2: {
type: 'reporter',
category: 'operators',
spec: 'atan2 %n ÷ %n'
},
reportMin: {
type: 'reporter',
category: 'operators',
@ -1649,21 +1654,28 @@ SpriteMorph.prototype.blockAlternatives = {
// operators:
reportSum: ['reportDifference', 'reportProduct', 'reportQuotient',
'reportPower', 'reportModulus', 'reportMin', 'reportMax'],
'reportPower', 'reportModulus', 'reportAtan2', 'reportMin',
'reportMax'],
reportDifference: ['reportSum', 'reportProduct', 'reportQuotient',
'reportPower', 'reportModulus', 'reportMin', 'reportMax'],
'reportPower', 'reportModulus', 'reportAtan2', 'reportMin',
'reportMax'],
reportProduct: ['reportDifference', 'reportSum', 'reportQuotient',
'reportPower', 'reportModulus', 'reportMin', 'reportMax'],
'reportPower', 'reportModulus', 'reportAtan2', 'reportMin',
'reportMax'],
reportQuotient: ['reportDifference', 'reportProduct', 'reportSum',
'reportPower', 'reportModulus', 'reportMin', 'reportMax'],
'reportPower', 'reportModulus', 'reportAtan2', 'reportMin',
'reportMax'],
reportPower: ['reportDifference', 'reportProduct', 'reportSum',
'reportQuotient', 'reportModulus', 'reportMin', 'reportMax'],
reportModulus: ['reportDifference', 'reportProduct', 'reportSum',
'reportQuotient', 'reportPower', 'reportMin', 'reportMax'],
reportMin: ['reportSum', 'reportDifference', 'reportProduct',
'reportQuotient', 'reportPower', 'reportModulus', 'reportMax'],
reportMax: ['reportSum', 'reportDifference', 'reportProduct',
'reportQuotient', 'reportPower', 'reportModulus', 'reportMin'],
'reportQuotient', 'reportModulus', 'reportAtan2', 'reportMin',
'reportMax'],
reportModulus: ['reportAtan2', 'reportDifference', 'reportProduct',
'reportSum','reportQuotient', 'reportPower', 'reportMin', 'reportMax'],
reportAtan2: ['reportModulus', 'reportDifference', 'reportProduct',
'reportSum','reportQuotient', 'reportPower', 'reportMin', 'reportMax'],
reportMin: ['reportMax', 'reportSum', 'reportDifference', 'reportProduct',
'reportQuotient', 'reportPower', 'reportModulus', 'reportAtan2'],
reportMax: ['reportMin', 'reportSum', 'reportDifference', 'reportProduct',
'reportQuotient', 'reportPower', 'reportModulus', 'reportAtan2'],
reportLessThan: ['reportLessThanOrEquals', 'reportEquals',
'reportGreaterThan', 'reportGreaterThanOrEquals'],
reportEquals: ['reportLessThan', 'reportLessThanOrEquals',

Wyświetl plik

@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, Map,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK,
TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/
modules.threads = '2020-December-07';
modules.threads = '2020-December-09';
var ThreadManager;
var Process;
@ -3721,6 +3721,14 @@ Process.prototype.reportBasicModulus = function (a, b) {
return ((x % y) + y) % y;
};
Process.prototype.reportAtan2 = function (a, b) {
return this.hyperDyadic(this.reportBasicAtan2, a, b);
};
Process.prototype.reportBasicAtan2 = function (a, b) {
return degrees(Math.atan2(+a, +b));
};
Process.prototype.reportMin = function (a, b) {
return this.hyperDyadic(this.reportBasicMin, a, b);
};