-
Notifications
You must be signed in to change notification settings - Fork 1
/
natentest.laze
2223 lines (2223 loc) · 158 KB
/
natentest.laze
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Load function ${"ja":"実数表示", "natja":"実数表示", "en":"printDouble", "naten":"printDouble"}$ from "log"of "console"that takes x as double .
Load function ${"ja":"デバッグ表示", "natja":"デバッグ表示", "en":"debug", "naten":"debug"}$ from "debug"of "console"that takes x as double .
Load function ${"ja":"行列表示", "natja":"行列表示", "en":"printMatrix", "naten":"printMatrix"}$ from "logMatrix"of "console"that takes element 4 in element 4 in offset as double .
Load function ${"ja":"アドレス表示", "natja":"アドレス表示", "en":"printAddress", "naten":"printAddress"}$ from "log"of "console"that takes x as pointer of void .
Load function ${"ja":"_文字列表示", "natja":"_文字列表示", "en":"_printString", "naten":"_printString"}$ from "logstring"of "console"that takes x as pointer of char , 長さ as int .
Load function ${"ja":"時間計測", "natja":"時間計測", "en":"getTime", "naten":"getTime"}$ from "performanceNow"of "std"that returns 時間 as double .
Load function ${"ja":"glClearDepth", "natja":"glClearDepth", "en":"glClearDepth", "naten":"glClearDepth"}$ from "clearDepth"of "graphics"that takes i as short .
Load function ${"ja":"glDepthFunc", "natja":"glDepthFunc", "en":"glDepthFunc", "naten":"glDepthFunc"}$ from "depthFunc"of "graphics"that takes i as short .
Load function ${"ja":"glEnable", "natja":"glEnable", "en":"glEnable", "naten":"glEnable"}$ from "enable"of "graphics"that takes i as short .
Load function ${"ja":"glDisable", "natja":"glDisable", "en":"glDisable", "naten":"glDisable"}$ from "disable"of "graphics"that takes i as short .
Load function ${"ja":"glCreateProgram", "natja":"glCreateProgram", "en":"glCreateProgram", "naten":"glCreateProgram"}$ from "createProgram"of "graphics"that returns prog as short .
Load function ${"ja":"glCreateBuffer", "natja":"glCreateBuffer", "en":"glCreateBuffer", "naten":"glCreateBuffer"}$ from "createBuffer"of "graphics"that returns buffer as short .
Load function ${"ja":"glBindBuffer", "natja":"glBindBuffer", "en":"glBindBuffer", "naten":"glBindBuffer"}$ from "bindBuffer"of "graphics"that takes i as short , j as short .
Load function ${"ja":"glBufferData", "natja":"glBufferData", "en":"glBufferData", "naten":"glBufferData"}$ from "bufferData"of "graphics"that takes i as short , offset as pointer of double , size as short , j as short .
Load function ${"ja":"glElementBufferData", "natja":"glElementBufferData", "en":"glElementBufferData", "naten":"glElementBufferData"}$ from "elementBufferData"of "graphics"that takes i as short , offset as pointer of short , size as short , j as short .
Load function ${"ja":"glUseProgram", "natja":"glUseProgram", "en":"glUseProgram", "naten":"glUseProgram"}$ from "useProgram"of "graphics"that takes i as short .
Load function ${"ja":"glGetAttribLocation", "natja":"glGetAttribLocation", "en":"glGetAttribLocation", "naten":"glGetAttribLocation"}$ from "getAttribLocation"of "graphics"that takes i as short , offset as pointer of char , size as short and returns loc as short .
Load function ${"ja":"glVertexAttribPointer", "natja":"glVertexAttribPointer", "en":"glVertexAttribPointer", "naten":"glVertexAttribPointer"}$ from "vertexAttribPointer"of "graphics"that takes index as short , size as short , ty as short , normalized as short , stride as short , offset as short .
Load function ${"ja":"glEnableVertexAttribArray", "natja":"glEnableVertexAttribArray", "en":"glEnableVertexAttribArray", "naten":"glEnableVertexAttribArray"}$ from "enableVertexAttribArray"of "graphics"that takes index as short .
Load function ${"ja":"glDrawArrays", "natja":"glDrawArrays", "en":"glDrawArrays", "naten":"glDrawArrays"}$ from "drawArrays"of "graphics"that takes i as short , first as short , count as short .
Load function ${"ja":"_glGetUniformLocation", "natja":"_glGetUniformLocation", "en":"_glGetUniformLocation", "naten":"_glGetUniformLocation"}$ from "getUniformLocation"of "graphics"that takes i as short , offset as pointer of char , size as short and returns loc as short .
Load function ${"ja":"glUniformMatrix2fv", "natja":"glUniformMatrix2fv", "en":"glUniformMatrix2fv", "naten":"glUniformMatrix2fv"}$ from "uniformMatrix2fv"of "graphics"that takes loc as short , trans as short , offset as pointer of double .
Load function ${"ja":"glUniformMatrix3fv", "natja":"glUniformMatrix3fv", "en":"glUniformMatrix3fv", "naten":"glUniformMatrix3fv"}$ from "uniformMatrix3fv"of "graphics"that takes loc as short , trans as short , offset as pointer of double .
Load function ${"ja":"glUniformMatrix4fv", "natja":"glUniformMatrix4fv", "en":"glUniformMatrix4fv", "naten":"glUniformMatrix4fv"}$ from "uniformMatrix4fv"of "graphics"that takes loc as short , trans as short , element 16 in offset as double .
Load function ${"ja":"glUniform1f", "natja":"glUniform1f", "en":"glUniform1f", "naten":"glUniform1f"}$ from "uniform1f"of "graphics"that takes loc as short , v0 as double .
Load function ${"ja":"glUniform1fv", "natja":"glUniform1fv", "en":"glUniform1fv", "naten":"glUniform1fv"}$ from "uniform1fv"of "graphics"that takes loc as short , v0 as double .
Load function ${"ja":"glUniform1i", "natja":"glUniform1i", "en":"glUniform1i", "naten":"glUniform1i"}$ from "uniform1i"of "graphics"that takes loc as short , v0 as short .
Load function ${"ja":"glUniform1iv", "natja":"glUniform1iv", "en":"glUniform1iv", "naten":"glUniform1iv"}$ from "uniform1iv"of "graphics"that takes loc as short , v0 as short .
Load function ${"ja":"glUniform2f", "natja":"glUniform2f", "en":"glUniform2f", "naten":"glUniform2f"}$ from "uniform2f"of "graphics"that takes loc as short , v0 as double , v1 as double .
Load function ${"ja":"glUniform2fv", "natja":"glUniform2fv", "en":"glUniform2fv", "naten":"glUniform2fv"}$ from "uniform2fv"of "graphics"that takes loc as short , v0 as double , v1 as double .
Load function ${"ja":"glUniform2i", "natja":"glUniform2i", "en":"glUniform2i", "naten":"glUniform2i"}$ from "uniform2i"of "graphics"that takes loc as short , v0 as short , v1 as short .
Load function ${"ja":"glUniform2iv", "natja":"glUniform2iv", "en":"glUniform2iv", "naten":"glUniform2iv"}$ from "uniform2iv"of "graphics"that takes loc as short , v0 as short , v1 as short .
Load function ${"ja":"glUniform3f", "natja":"glUniform3f", "en":"glUniform3f", "naten":"glUniform3f"}$ from "uniform3f"of "graphics"that takes loc as short , v0 as double , v1 as double , v2 as double .
Load function ${"ja":"glUniform3fv", "natja":"glUniform3fv", "en":"glUniform3fv", "naten":"glUniform3fv"}$ from "uniform3fv"of "graphics"that takes loc as short , v0 as double , v1 as double , v2 as double .
Load function ${"ja":"glUniform3i", "natja":"glUniform3i", "en":"glUniform3i", "naten":"glUniform3i"}$ from "uniform3i"of "graphics"that takes loc as short , v0 as short , v1 as short , v2 as short .
Load function ${"ja":"glUniform3iv", "natja":"glUniform3iv", "en":"glUniform3iv", "naten":"glUniform3iv"}$ from "uniform3iv"of "graphics"that takes loc as short , v0 as short , v1 as short , v2 as short .
Load function ${"ja":"glUniform4f", "natja":"glUniform4f", "en":"glUniform4f", "naten":"glUniform4f"}$ from "uniform4f"of "graphics"that takes loc as short , v0 as double , v1 as double , v2 as double , v3 as double .
Load function ${"ja":"glUniform4fv", "natja":"glUniform4fv", "en":"glUniform4fv", "naten":"glUniform4fv"}$ from "uniform4fv"of "graphics"that takes loc as short , v0 as double , v1 as double , v2 as double , v3 as double .
Load function ${"ja":"glUniform4i", "natja":"glUniform4i", "en":"glUniform4i", "naten":"glUniform4i"}$ from "uniform4i"of "graphics"that takes loc as short , v0 as short , v1 as short , v2 as short , v3 as short .
Load function ${"ja":"glUniform4iv", "natja":"glUniform4iv", "en":"glUniform4iv", "naten":"glUniform4iv"}$ from "uniform4iv"of "graphics"that takes loc as short , v0 as short , v1 as short , v2 as short , v3 as short .
Load function ${"ja":"glClearColor", "natja":"glClearColor", "en":"glClearColor", "naten":"glClearColor"}$ from "clearColor"of "graphics"that takes r as double , g as double , b as double , a as double .
Load function ${"ja":"glClear", "natja":"glClear", "en":"glClear", "naten":"glClear"}$ from "clear"of "graphics"that takes color as short .
Load function ${"ja":"glDrawElements", "natja":"glDrawElements", "en":"glDrawElements", "naten":"glDrawElements"}$ from "drawElements"of "graphics"that takes i as short , count as short , ty as short , offset as short .
Load function ${"ja":"glBlendFunc", "natja":"glBlendFunc", "en":"glBlendFunc", "naten":"glBlendFunc"}$ from "blendFunc"of "graphics"that takes i as short , j as short .
Load function ${"ja":"キーチェック", "natja":"キーチェック", "en":"checkKeyPress", "naten":"checkKeyPress"}$ from "checkKeyPress"of "std"that takes keyCode as short and returns pressed as int .
Load function ${"ja":"マウスチェック", "natja":"マウスチェック", "en":"checkMousePress", "naten":"checkMousePress"}$ from "checkMousePress"of "std"that returns pressed as int .
Load function ${"ja":"マウス相対座標X", "natja":"マウス相対座標X", "en":"checkRelativeMouseX", "naten":"checkRelativeMouseX"}$ from "checkRelativeMouseX"of "std"that returns x as double .
Load function ${"ja":"マウス相対座標Y", "natja":"マウス相対座標Y", "en":"checkRelativeMouseY", "naten":"checkRelativeMouseY"}$ from "checkRelativeMouseY"of "std"that returns x as double .
Load function ${"ja":"マウス絶対座標X", "natja":"マウス絶対座標X", "en":"checkAbsoluteMouseX", "naten":"checkAbsoluteMouseX"}$ from "checkAbsoluteMouseX"of "std"that returns x as double .
Load function ${"ja":"マウス絶対座標Y", "natja":"マウス絶対座標Y", "en":"checkAbsoluteMouseY", "naten":"checkAbsoluteMouseY"}$ from "checkAbsoluteMouseY"of "std"that returns x as double .
Load function ${"ja":"スクロール座標", "natja":"スクロール座標", "en":"checkScroll", "naten":"checkScroll"}$ from "checkScrollY"of "std"that returns x as double .
Load function ${"ja":"ランダム数生成", "natja":"ランダム数生成", "en":"rand", "naten":"rand"}$ from "rand"of "std"that returns x as double .
Load function ${"ja":"メモリ確保", "natja":"メモリ確保", "en":"allocMemory", "naten":"allocMemory"}$ from "alloc"of "std"that takes size as short and returns p as pointer of void .
Load function ${"ja":"テクスチャロード", "natja":"テクスチャロード", "en":"_loadTexture", "naten":"_loadTexture"}$ from "loadTexture"of "graphics"that takes offset as pointer of char , length as short and returns a as short .
Load function ${"ja":"glActiveTexture", "natja":"glActiveTexture", "en":"glActiveTexture", "naten":"glActiveTexture"}$ from "activeTexture"of "graphics"that takes i as short .
Load function ${"ja":"glBindTexture", "natja":"glBindTexture", "en":"glBindTexture", "naten":"glBindTexture"}$ from "bindTexture"of "graphics"that takes i as short , j as short .
Load function ${"ja":"マウスキャプチャ", "natja":"マウスキャプチャ", "en":"captureMouse", "naten":"captureMouse"}$ from "lockPointer"of "graphics".
Load function ${"ja":"Arduino設定", "natja":"Arduino設定", "en":"ArduinoSetup", "naten":"ArduinoSetup"}$ from "setUp"of "arduino"that takes vendorId as int , c as function : ( ) => ( ) .
Load function ${"ja":"Arduinoコマンド送信", "natja":"Arduinoコマンド送信", "en":"ArduinoSendCommand", "naten":"ArduinoSendCommand"}$ from "sendCommand"of "arduino"that takes コマンド as char , data as short .
Load function ${"ja":"Arduinoデータ受信", "natja":"Arduinoデータ受信", "en":"ArduinoReceiveData", "naten":"ArduinoReceiveData"}$ from "checkInput"of "arduino".
Load function ${"ja":"Arduinoアナログ入力", "natja":"Arduinoアナログ入力", "en":"ArduinoAnalogInput", "naten":"ArduinoAnalogInput"}$ from "analogRead"of "arduino"that takes ピン番号 as int and returns データ as short .
Load function ${"ja":"Arduinoデジタル入力", "natja":"Arduinoデジタル入力", "en":"ArduinoDigitalInput", "naten":"ArduinoDigitalInput"}$ from "digitalRead"of "arduino"that takes ピン番号 as int and returns データ as short .
Load function ${"ja":"ArduinoHCSR04距離入力", "natja":"ArduinoHCSR04距離入力", "en":"ArduinoHCSR04DistanceInput", "naten":"ArduinoHCSR04DistanceInput"}$ from "distanceRead"of "arduino"that takes ピン番号 as int and returns データ as short .
Load function getTeapot from "getTeapot"of "graphics"that returns s as pointer of void .
Load function getMountains from "getMountains"of "graphics"that returns s as pointer of void .
Load function getTeddybear from "getTeddybear"of "graphics"that returns s as pointer of void .
Load function getCow from "getCow"of "graphics"that returns s as pointer of void .
Load function getFox from "getFox"of "graphics"that returns s as pointer of void .
Load function getRobot from "getRobot"of "graphics"that returns s as pointer of void .
Load function getCheckpoint from "getCheckpoint"of "graphics"that returns s as pointer of void .
Load function jsArcSin from "asin"of "std"that takes x as double and returns r as double .
Load function jsArcCos from "acos"of "std"that takes x as double and returns r as double .
Load function jsArcTan from "atan"of "std"that takes x as double and returns r as double .
Load function jsLog from "log"of "std"that takes x as double and returns r as double .
Load function jsEPow from "ePow"of "std"that takes x as double and returns r as double .
Load function jsPow from "exp"of "std"that takes x as double , y as double and returns r as double .
Load function updateLinetraceTime from "updateLinetraceTime"of "linetrace"that takes x as double .
Declare function ${"ja":"sin", "natja":"sin", "en":"sin", "naten":"sin"}$ that takes input as double and returns 結果 as double with code starting here
Initialize variable PI as double with 3.14159265358979312 .
Initialize variable temp as int with input / ( 2.0 * PI ) .
Initialize variable rad as double with input - ( 2.0 * PI * temp ) .
Initialize variable plusminus as double with 1.0 .
If rad < 0.0 then execute code starting here
Assign rad + ( 2.0 * PI ) to rad .
ending here
If rad > PI then execute code starting here
Assign 0 - 1.0 to plusminus .
If rad > 1.5 * PI then execute code starting here
Assign ( 2.0 * PI ) - rad to rad .
ending here Otherwise execute code starting here
Assign rad - PI to rad .
ending here
ending here Otherwise execute code starting here
If rad > 0.5 * PI then execute code starting here
Assign PI - rad to rad .
ending here
ending here
If rad > 0.25 * PI then execute code starting here
Assign ( 0.5 * PI ) - rad to rad .
Initialize variable doubleRad as double with rad * rad .
Assign 1.0 - ( doubleRad ) / 2.0 + ( doubleRad * doubleRad ) / 24.0 - ( doubleRad * doubleRad * doubleRad ) / 720.0 + ( doubleRad * doubleRad * doubleRad * doubleRad ) / 40320.0 - ( doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 3628800.0 + ( doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 479001600.0 to 結果 .
Assign 結果 * plusminus to 結果 .
ending here Otherwise execute code starting here
Initialize variable doubleRad as double with rad * rad .
Assign rad - ( rad * doubleRad ) / 6.0 + ( rad * doubleRad * doubleRad ) / 120.0 - ( rad * doubleRad * doubleRad * doubleRad ) / 5040.0 + ( rad * doubleRad * doubleRad * doubleRad * doubleRad ) / 362880.0 - ( rad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 39916800.0 + ( rad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 6227020800.0 - ( rad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 1307674368000.0 to 結果 .
Assign 結果 * plusminus to 結果 .
ending here
ending here
Declare function ${"ja":"cos", "natja":"cos", "en":"cos", "naten":"cos"}$ that takes input as double and returns 結果 as double with code starting here
Initialize variable PI as double with 3.14159265358979312 .
Initialize variable temp as int with input / ( 2 * PI ) .
Initialize variable rad as double with input - ( 2 * PI * temp ) .
Initialize variable plusminus as double with 1.0 .
If rad < 0.0 then execute code starting here
Assign rad + ( 2.0 * PI ) to rad .
ending here
If rad > PI then execute code starting here
If rad > 1.5 * PI then execute code starting here
Assign ( 2.0 * PI ) - rad to rad .
ending here Otherwise execute code starting here
Assign 0 - 1.0 to plusminus .
Assign rad - PI to rad .
ending here
ending here Otherwise execute code starting here
If rad > 0.5 * PI then execute code starting here
Assign 0 - 1.0 to plusminus .
Assign PI - rad to rad .
ending here
ending here
If rad < 0.25 * PI then execute code starting here
Initialize variable doubleRad as double with rad * rad .
Assign 1.0 - ( doubleRad ) / 2.0 + ( doubleRad * doubleRad ) / 24.0 - ( doubleRad * doubleRad * doubleRad ) / 720.0 + ( doubleRad * doubleRad * doubleRad * doubleRad ) / 40320.0 - ( doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 3628800.0 + ( doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 479001600.0 to 結果 .
Assign 結果 * plusminus to 結果 .
ending here Otherwise execute code starting here
Assign ( 0.5 * PI ) - rad to rad .
Initialize variable doubleRad as double with rad * rad .
Assign rad - ( rad * doubleRad ) / 6.0 + ( rad * doubleRad * doubleRad ) / 120.0 - ( rad * doubleRad * doubleRad * doubleRad ) / 5040.0 + ( rad * doubleRad * doubleRad * doubleRad * doubleRad ) / 362880.0 - ( rad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 39916800.0 + ( rad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 6227020800.0 - ( rad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad * doubleRad ) / 1307674368000.0 to 結果 .
Assign 結果 * plusminus to 結果 .
ending here
ending here
Declare function ${"ja":"tan", "natja":"tan", "en":"tan", "naten":"tan"}$ that takes rad as double and returns 結果 as double with code starting here
Initialize variable PI as double with 3.14159265358979312 .
Initialize variable sqRad as double with rad * rad .
Assign sin ( rad ) / cos ( rad ) to 結果 .
ending here
Declare function ${"ja":"絶対値", "natja":"絶対値", "en":"abs", "naten":"abs"}$ that takes a as double and returns b as double with code starting here
If a >= 0 then execute code starting here
Assign a to b .
ending here Otherwise execute code starting here
Assign ( 0 - ( a ) ) to b .
ending here
ending here
Declare function ${"ja":"ラジアンへ", "natja":"ラジアンへ", "en":"toRad", "naten":"toRad"}$ that takes deg as double and returns rad as double with code starting here
Initialize variable PI as double with 3.14159265358979312 .
Assign ( deg / 180 ) * PI to rad .
ending here
Declare function ${"ja":"平方根", "natja":"平方根", "en":"root", "naten":"root"}$ that takes x as double and returns y as double with code starting here
Assign 5 to y .
( Initialize variable i as int with 0 . ) from ( i == 20 ) to ( Assign i + 1 to i . ) starting here
Assign 0.5 * ( y + ( x / y ) ) to y .
ending here
ending here
Declare function ${"ja":"線分当たり判定", "natja":"線分当たり判定", "en":"checkLineCross", "naten":"checkLineCross"}$ that takes ax as double , ay as double , bx as double , byp as double , cx as double , cy as double , dx as double , dy as double and returns b as bool with code starting here
Initialize variable ta as double with ( cx - dx ) * ( ay - cy ) + ( cy - dy ) * ( cx - ax ) .
Initialize variable tb as double with ( cx - dx ) * ( byp - cy ) + ( cy - dy ) * ( cx - bx ) .
Initialize variable tc as double with ( ax - bx ) * ( cy - ay ) + ( ay - byp ) * ( ax - cx ) .
Initialize variable td as double with ( ax - bx ) * ( dy - ay ) + ( ay - byp ) * ( ax - dx ) .
Assign ( ( tc * td ) < 0 ) && ( ( ta * tb ) < 0 ) to b .
ending here
Declare template that takes T . Declare class ${"ja":"配列", "natja":"配列", "en":"Array", "naten":"Array"}$ with members starting here
public : Declare variable content as pointer of T .
Declare variable size as int .
Declare variable allocated as int .
Declare function Array with code starting here
Assign 0 to size .
Assign 4 to allocated .
Assign allocMemory ( sizeof ( variable at content ) * allocated ) to content .
ending here
Declare function ${"ja":"取得", "natja":"取得", "en":"get", "naten":"get"}$ that takes index as int and returns result as T with code starting here
Return value element index in content .
ending here
Declare function ${"ja":"追加", "natja":"追加", "en":"push", "naten":"push"}$ that takes new as T with code starting here
If size == allocated then execute code starting here
Assign allocated * 2 to allocated .
Initialize variable temp as pointer of T with content .
Assign allocMemory ( sizeof ( variable at content ) * allocated ) to content .
( Initialize variable i as int with 0 . ) from ( i == ( allocated / 2 ) ) to ( Assign i + 1 to i . ) starting here
Assign element i in temp to element i in content .
ending here
ending here
Assign new to element size in content .
Assign size + 1 to size .
ending here
Declare function ${"ja":"長さ", "natja":"長さ", "en":"length", "naten":"length"}$ that returns a as int with code starting here
Assign size to a .
ending here
Declare function ${"ja":"ポップ", "natja":"ポップ", "en":"pop", "naten":"pop"}$ with code starting here
Assign size - 1 to size .
ending here
function : operator = ( offset as pointer of T , l as int ) => ( ) starting here
Assign offset to content .
Assign l to size .
ending here
function : operator = ( a as Array < T > ) => ( ) starting here
Assign allocMemory ( sizeof ( variable at content ) * ( allocated of a ) ) to content .
Assign size of a to size .
Assign allocated of a to allocated .
repeat size times starting here
Assign element counter in content of a to element counter in content .
ending here
ending here
function : operator == ( a as Array < T > ) => ( b as bool ) starting here
Assign true to b .
If size != size of a then execute code starting here
Return value false .
ending here
repeat size times starting here
If element counter in content != element counter in content of a then execute code starting here
Return value false .
ending here
ending here
ending here
function : operator == ( offset as pointer of T , l as int ) => ( b as bool ) starting here
Assign true to b .
If size != l then execute code starting here
Return value false .
ending here
repeat size times starting here
If element counter in content != element counter in offset then execute code starting here
Return value false .
ending here
ending here
ending here
function : operator != ( a as Array < T > ) => ( b as bool ) starting here
Assign false to b .
If size != size of a then execute code starting here
Return value true .
ending here
repeat size times starting here
If element counter in content != element counter in content of a then execute code starting here
Return value true .
ending here
ending here
ending here
function : operator != ( offset as pointer of T , l as int ) => ( b as bool ) starting here
Assign false to b .
If size != l then execute code starting here
Return value true .
ending here
repeat size times starting here
If element counter in content != element counter in offset then execute code starting here
Return value true .
ending here
ending here
ending here
function : operator + ( a as Array < T > ) => ( b as Array < T > ) starting here
Declare variable 結果 as Array < T > .
repeat size times starting here
Call push of 結果 with value element counter in content .
ending here
repeat size of a times starting here
Call push of 結果 with value get of a ( counter ) .
ending here
Return value 結果 .
ending here
function : operator + ( offset as pointer of T , l as int ) => ( b as Array < T > ) starting here
Declare variable 結果 as Array < T > .
repeat size times starting here
Call push of 結果 with value element counter in content .
ending here
repeat l times starting here
Call push of 結果 with value element counter in offset .
ending here
Return value 結果 .
ending here
Declare function ${"ja":"全要素操作", "natja":"全要素操作", "en":"forEach", "naten":"forEach"}$ that takes c as function : ( a as T ) => ( ) with code starting here
repeat size times starting here
Call c with value element counter in content .
ending here
ending here
Declare function ${"ja":"全要素変更", "natja":"全要素変更", "en":"map", "naten":"map"}$ that takes c as function : ( a as T ) => ( b as T ) with code starting here
Declare variable 結果 as Array < T > .
Assign allocMemory ( sizeof ( variable at content ) * ( allocated ) ) to content of 結果 .
Assign size to size of 結果 .
Assign allocated to allocated of 結果 .
repeat size times starting here
Assign c ( element counter in content ) to element counter in content of 結果 .
ending here
Return value 結果 .
ending here
Declare function __ソート that takes s as int , e as int , c as function : ( a as T , b as T ) => ( r as int ) with code starting here
If s < e then execute code starting here
Initialize variable loc as int with e .
Initialize variable pivot as T with element loc in content .
Initialize variable i as int with s - 1 .
Initialize variable l as int with e - s .
repeat l times starting here
If c ( element counter + s in content , pivot ) < 0 then execute code starting here
Assign i + 1 to i .
Initialize variable temp as T with element counter + s in content .
Assign element i in content to element counter + s in content .
Assign temp to element i in content .
ending here
ending here
Initialize variable temp as T with element loc in content .
Assign element i + 1 in content to element loc in content .
Assign temp to element i + 1 in content .
Call __ソート with value s , i , c .
Call __ソート with value i + 2 , e , c .
ending here
ending here
Declare function ${"ja":"ソート", "natja":"ソート", "en":"sort", "naten":"sort"}$ that takes c as function : ( a as T , b as T ) => ( r as int ) with code starting here
Call __ソート with value 0 , size - 1 , c .
ending here
Declare function ${"ja":"フィルター", "natja":"フィルター", "en":"filter", "naten":"filter"}$ that takes c as function : ( a as T ) => ( r as bool ) and returns b as Array < T > with code starting here
Declare variable 結果 as Array < T > .
repeat size times starting here
If c ( element counter in content ) then execute code starting here
Call push of 結果 with value element counter in content .
ending here
ending here
Return value 結果 .
ending here
Declare function ${"ja":"削除", "natja":"削除", "en":"remove", "naten":"remove"}$ that takes i as int and returns b as Array < T > with code starting here
Declare variable 結果 as Array < T > .
repeat size times starting here
If counter != i then execute code starting here
Call push of 結果 with value element counter in content .
ending here
ending here
Return value 結果 .
ending here
Declare function ${"ja":"範囲削除", "natja":"範囲削除", "en":"removeRange", "naten":"removeRange"}$ that takes i as int , r as int and returns b as Array < T > with code starting here
Declare variable 結果 as Array < T > .
repeat size times starting here
If ( counter < i ) || ( counter >= ( i + r ) ) then execute code starting here
Call push of 結果 with value element counter in content .
ending here
ending here
Return value 結果 .
ending here
Declare function ${"ja":"部分列", "natja":"部分列", "en":"subseq", "naten":"subseq"}$ that takes s as int , e as int and returns b as Array < T > with code starting here
Declare variable 結果 as Array < T > .
If s >= e then execute code starting here
Return value 結果 .
ending here
repeat size times starting here
If ( s <= counter ) && ( counter < e ) then execute code starting here
Call push of 結果 with value element counter in content .
ending here
ending here
Return value 結果 .
ending here
Declare function ${"ja":"範囲部分列", "natja":"範囲部分列", "en":"subseqRange", "naten":"subseqRange"}$ that takes s as int , l as int and returns b as Array < T > with code starting here
Declare variable 結果 as Array < T > .
If s >= size then execute code starting here
Return value 結果 .
ending here
repeat size times starting here
If ( s <= counter ) && ( counter < ( s + l ) ) then execute code starting here
Call push of 結果 with value element counter in content .
ending here
ending here
Return value 結果 .
ending here
Declare function ${"ja":"置換", "natja":"置換", "en":"replace", "naten":"replace"}$ that takes a as T , b as T with code starting here
repeat size times starting here
If element counter in content == a then execute code starting here
Assign b to element counter in content .
ending here
ending here
ending here
Declare function ${"ja":"範囲置換", "natja":"範囲置換", "en":"replaceRange", "naten":"replaceRange"}$ that takes s as int , l as int , a as T with code starting here
repeat size times starting here
If ( s <= counter ) && ( counter < ( s + l ) ) then execute code starting here
Assign a to element counter in content .
ending here
ending here
ending here
Declare function ${"ja":"範囲置換", "natja":"範囲置換", "en":"replaceRange", "naten":"replaceRange"}$ that takes s as int , l as int , a as Array < T > with code starting here
repeat size times starting here
If ( s <= counter ) && ( counter < ( s + l ) ) then execute code starting here
Assign element counter - s in content of a to element counter in content .
ending here
ending here
ending here
Declare function ${"ja":"探索", "natja":"探索", "en":"find", "naten":"find"}$ that takes b as T and returns i as int with code starting here
repeat size times starting here
If element counter in content == b then execute code starting here
Return value counter .
ending here
ending here
Return value size .
ending here
ending here
Declare function ${"ja":"整数文字変換", "natja":"整数文字変換", "en":"intToChar", "naten":"intToChar"}$ that takes a as int and returns b as char with code starting here
Assign a % ( 10 ) to a .
If a == 0 then execute code starting here
Assign '0'to b .
ending here Otherwise If a == 1 then execute code starting here
Assign '1'to b .
ending here
Otherwise If a == 2 then execute code starting here
Assign '2'to b .
ending here Otherwise If a == 3 then execute code starting here
Assign '3'to b .
ending here Otherwise If a == 4 then execute code starting here
Assign '4'to b .
ending here Otherwise If a == 5 then execute code starting here
Assign '5'to b .
ending here Otherwise If a == 6 then execute code starting here
Assign '6'to b .
ending here Otherwise If a == 7 then execute code starting here
Assign '7'to b .
ending here Otherwise If a == 8 then execute code starting here
Assign '8'to b .
ending here Otherwise If a == 9 then execute code starting here
Assign '9'to b .
ending here
ending here
Declare class ${"ja":"文字列", "natja":"文字列", "en":"string", "naten":"string"}$ with members starting here
public : Declare variable content as pointer of char .
Declare variable length as int .
Declare function string that takes offset as pointer of char , l as int with code starting here
Assign offset to content .
Assign l to length .
ending here
Declare function string with code starting here
Assign allocMemory ( 0 ) to content .
Assign 0 to length .
ending here
function : operator = ( offset as pointer of char , l as int ) => ( ) starting here
Assign offset to content .
Assign l to length .
ending here
function : operator = ( a as string ) => ( ) starting here
Assign allocMemory ( sizeof ( variable at content ) * ( length of a ) ) to content .
Assign length of a to length .
repeat length times starting here
Assign element counter in content of a to element counter in content .
ending here
ending here
function : operator = ( a as char ) => ( ) starting here
Assign allocMemory ( sizeof ( variable at content ) ) to content .
Assign 1 to length .
Assign a to element 0 in content .
ending here
function : operator + ( a as char ) => ( b as string ) starting here
Assign allocMemory ( sizeof ( variable at content ) * ( length + 1 ) ) to content of b .
repeat length times starting here
Assign element counter in content to element counter in content of b .
ending here
Assign a to element length in content of b .
Assign length + 1 to length of b .
ending here
function : operator + ( offset as pointer of char , l as int ) => ( b as string ) starting here
Assign allocMemory ( sizeof ( variable at content ) * ( length + l ) ) to content of b .
repeat length times starting here
Assign element counter in content to element counter in content of b .
ending here
repeat l times starting here
Assign element counter in offset to element length + counter in content of b .
ending here
Assign length + l to length of b .
ending here
function : operator + ( a as string ) => ( b as string ) starting here
Assign allocMemory ( sizeof ( variable at content ) * ( length + length of a ) ) to content of b .
repeat length times starting here
Assign element counter in content to element counter in content of b .
ending here
repeat length of a times starting here
Assign element counter in content of a to element length + counter in content of b .
ending here
Assign length + length of a to length of b .
ending here
function : operator + ( a as int ) => ( b as string ) starting here
Initialize variable str as string with intToChar ( a ) .
If abs ( a ) >= 10 then execute code starting here
Until a <= 10 starting here
Assign a / ( 10 ) to a .
Initialize variable temp as string with intToChar ( a ) .
Assign temp + str to str .
ending here
ending here
Assign allocMemory ( sizeof ( variable at content ) * length ) to content of b .
repeat length times starting here
Assign element counter in content to element counter in content of b .
ending here
Assign length to length of b .
Assign b + str to b .
ending here
function : operator + ( a as short ) => ( b as string ) starting here
Initialize variable str as string with intToChar ( a ) .
Until a <= 10 starting here
Assign a / ( 10 ) to a .
Initialize variable temp as string with intToChar ( a ) .
Assign temp + str to str .
ending here
Assign allocMemory ( sizeof ( variable at content ) * length ) to content of b .
repeat length times starting here
Assign element counter in content to element counter in content of b .
ending here
Assign length to length of b .
Assign b + str to b .
ending here
function : operator + ( a as double ) => ( b as string ) starting here
Initialize variable inta as int with a .
Initialize variable reala as double with a - inta .
Initialize variable str as string with "".
Assign str + inta to str .
Assign str + "."to str .
repeat 6 times starting here
Assign reala * ( 10.0 ) to reala .
Assign str + intToChar ( reala ) to str .
ending here
Assign allocMemory ( sizeof ( variable at content ) * length ) to content of b .
repeat length times starting here
Assign element counter in content to element counter in content of b .
ending here
Assign length to length of b .
Assign b + str to b .
ending here
function : operator == ( a as string ) => ( b as bool ) starting here
Assign true to b .
If length != length of a then execute code starting here
Return value false .
ending here
repeat length times starting here
If element counter in content != element counter in content of a then execute code starting here
Return value false .
ending here
ending here
ending here
function : operator == ( offset as pointer of char , l as int ) => ( b as bool ) starting here
Assign true to b .
If length != l then execute code starting here
Return value false .
ending here
repeat length times starting here
If element counter in content != element counter in offset then execute code starting here
Return value false .
ending here
ending here
ending here
function : operator != ( a as string ) => ( b as bool ) starting here
Assign false to b .
If length != length of a then execute code starting here
Return value true .
ending here
repeat length times starting here
If element counter in content != element counter in content of a then execute code starting here
Return value true .
ending here
ending here
ending here
function : operator != ( offset as pointer of char , l as int ) => ( b as bool ) starting here
Assign false to b .
If length != l then execute code starting here
Return value true .
ending here
repeat length times starting here
If element counter in content != element counter in offset then execute code starting here
Return value true .
ending here
ending here
ending here
Declare function ${"ja":"切り取り", "natja":"切り取り", "en":"substr", "naten":"substr"}$ that takes s as int , e as int and returns b as string with code starting here
If s > length then execute code starting here
Assign length to s .
ending here
If e > length then execute code starting here
Assign length to e .
ending here
Assign allocMemory ( sizeof ( variable at content ) * ( e - s ) ) to content of b .
Assign e - s to length of b .
( Initialize variable i as int with s . ) from ( i == e ) to ( Assign i + 1 to i . ) starting here
Assign element i in content to element i - s in content of b .
ending here
ending here
Declare function ${"ja":"範囲切り取り", "natja":"範囲切り取り", "en":"substrRange", "naten":"substrRange"}$ that takes s as int , l as int and returns b as string with code starting here
If s > length then execute code starting here
Assign length to s .
ending here
If s + l > length then execute code starting here
Assign length - s to l .
ending here
Assign allocMemory ( sizeof ( variable at content ) * l ) to content of b .
Assign l to length of b .
( Initialize variable i as int with s . ) from ( i == ( s + l ) ) to ( Assign i + 1 to i . ) starting here
Assign element i in content to element i - s in content of b .
ending here
ending here
Declare function ${"ja":"分割", "natja":"分割", "en":"separate", "naten":"separate"}$ that takes a as char and returns b as Array < string > with code starting here
Declare variable 結果 as Array < string > .
Initialize variable 開始 as int with 0 .
repeat length times starting here
If element counter in content == a then execute code starting here
Initialize variable temp as string with substr ( 開始 , counter ) .
Call push of 結果 with value temp .
Assign counter + 1 to 開始 .
ending here
ending here
Call push of 結果 with value substr ( 開始 , length ) .
Return value 結果 .
ending here
Declare function ${"ja":"整数変換", "natja":"整数変換", "en":"toInteger", "naten":"toInteger"}$ that returns a as int with code starting here
Assign 0 to a .
repeat length times starting here
Initialize variable c as char with element counter in content .
If c != '-'then execute code starting here
Assign a * ( 10 ) to a .
ending here
If c == '1'then execute code starting here
Assign a + 1 to a .
ending here
If c == '2'then execute code starting here
Assign a + 2 to a .
ending here
If c == '3'then execute code starting here
Assign a + 3 to a .
ending here
If c == '4'then execute code starting here
Assign a + 4 to a .
ending here
If c == '5'then execute code starting here
Assign a + 5 to a .
ending here
If c == '6'then execute code starting here
Assign a + 6 to a .
ending here
If c == '7'then execute code starting here
Assign a + 7 to a .
ending here
If c == '8'then execute code starting here
Assign a + 8 to a .
ending here
If c == '9'then execute code starting here
Assign a + 9 to a .
ending here
ending here
If element 0 in content == '-'then execute code starting here
Assign a * ( ( 0 - ( 1.0 ) ) ) to a .
ending here
ending here
Declare function ${"ja":"実数変換", "natja":"実数変換", "en":"toDouble", "naten":"toDouble"}$ that returns a as double with code starting here
Assign 0 to a .
If element 0 in content == '-'then execute code starting here
Initialize variable str as string with substrRange ( 1 , length ) .
Assign toDouble of str ( ) * ( 0 - ( 1.0 ) ) to a .
ending here Otherwise execute code starting here
Initialize variable b as Array < string > with separate ( '.') .
If length of b ( ) != 2 then execute code starting here
Return value 0.0 .
ending here
Assign a + toInteger of element 0 in content of b ( ) to a .
Initialize variable temp as double with toInteger of element 1 in content of b ( ) .
repeat length of element 1 in content of b times starting here
Assign temp * ( 0.100000000000000006 ) to temp .
ending here
Assign a + temp to a .
ending here
ending here
Declare function ${"ja":"置換", "natja":"置換", "en":"replace", "naten":"replace"}$ that takes a as string , b as string and returns c as string with code starting here
Declare variable 結果 as string .
Initialize variable 開始 as int with 0 .
repeat length times starting here
If element counter in content == element 0 in content of a then execute code starting here
If substrRange ( counter , length of a ) == a then execute code starting here
Assign 結果 + substr ( 開始 , counter ) to 結果 .
Assign 結果 + b to 結果 .
Assign counter + length of a to counter .
Assign counter to 開始 .
ending here
ending here
ending here
Assign 結果 + substr ( 開始 , length ) to 結果 .
Return value 結果 .
ending here
ending here
Declare function ${"ja":"文字列表示", "natja":"文字列表示", "en":"printString", "naten":"printString"}$ that takes a as string with code starting here
Call _printString with value content of a , length of a .
ending here
Declare function ${"ja":"表示", "natja":"表示", "en":"print", "naten":"print"}$ that takes x as double with code starting here
Call printDouble with value x .
ending here
Declare function ${"ja":"表示", "natja":"表示", "en":"print", "naten":"print"}$ that takes n as int with code starting here
Call printDouble with value n .
ending here
Declare function ${"ja":"表示", "natja":"表示", "en":"print", "naten":"print"}$ that takes n as short with code starting here
Call printDouble with value n .
ending here
Declare function ${"ja":"表示", "natja":"表示", "en":"print", "naten":"print"}$ that takes a as string with code starting here
Call printString with value a .
ending here
Declare function ${"ja":"glGetUniformLocation", "natja":"glGetUniformLocation", "en":"glGetUniformLocation", "naten":"glGetUniformLocation"}$ that takes i as short , a as string and returns loc as short with code starting here
Assign _glGetUniformLocation ( i , content of a , length of a ) to loc .
ending here
Declare function ${"ja":"サンプルモデルロード", "natja":"サンプルモデルロード", "en":"loadSampleModel", "naten":"loadSampleModel"}$ that takes a as string and returns b as string with code starting here
Initialize variable data as pointer of string with "".
If a == "teapot"then execute code starting here
Assign getTeapot ( ) to data .
ending here
If a == "mountains"then execute code starting here
Assign getMountains ( ) to data .
ending here
If a == "teddybear"then execute code starting here
Assign getTeddybear ( ) to data .
ending here
If a == "cow"then execute code starting here
Assign getCow ( ) to data .
ending here
If a == "fox"then execute code starting here
Assign getFox ( ) to data .
ending here
If a == "robot"then execute code starting here
Assign getRobot ( ) to data .
ending here
If a == "checkpoint"then execute code starting here
Assign getCheckpoint ( ) to data .
ending here
Assign variable at data to b .
ending here
Declare class ${"ja":"ベクトル3D", "natja":"ベクトル3D", "en":"Vector3D", "naten":"Vector3D"}$ with members starting here
public : Declare variable x as double .
Declare variable y as double .
Declare variable z as double .
Declare function Vector3D that takes a as double , b as double , c as double with code starting here
Assign a to x .
Assign b to y .
Assign c to z .
ending here
Declare function ${"ja":"長さ", "natja":"長さ", "en":"length", "naten":"length"}$ that returns l as double with code starting here
Assign root ( x * x + y * y + z * z ) to l .
ending here
Declare function ${"ja":"正規化", "natja":"正規化", "en":"normalize", "naten":"normalize"}$ with code starting here
Initialize variable l as double with root ( ( x * x ) + ( y * y ) + ( z * z ) ) .
Assign x / l to x .
Assign y / l to y .
Assign z / l to z .
ending here
function : operator + ( a as Vector3D ) => ( b as Vector3D ) starting here
Assign x of a + x to x of b .
Assign y of a + y to y of b .
Assign z of a + z to z of b .
ending here
function : operator - ( a as Vector3D ) => ( b as Vector3D ) starting here
Assign x - x of a to x of b .
Assign y - y of a to y of b .
Assign z - z of a to z of b .
ending here
function : operator * ( k as double ) => ( b as Vector3D ) starting here
Assign x * k to x of b .
Assign y * k to y of b .
Assign z * k to z of b .
ending here
function : operator * ( a as Vector3D ) => ( b as Vector3D ) starting here
Assign y * z of a - z * y of a to x of b .
Assign z * x of a - x * z of a to y of b .
Assign x * y of a - y * x of a to z of b .
ending here
function : operator / ( k as double ) => ( b as Vector3D ) starting here
Assign x / k to x of b .
Assign y / k to y of b .
Assign z / k to z of b .
ending here
function : operator == ( a as Vector3D ) => ( b as bool ) starting here
Assign ( ( x of a == x ) && ( y of a == y ) && ( z of a == z ) ) to b .
ending here
function : operator != ( a as Vector3D ) => ( b as bool ) starting here
Assign ( ( x of a != x ) || ( y of a != y ) || ( z of a != z ) ) to b .
ending here
ending here
Declare function ${"ja":"ベクトル3Dの和", "natja":"ベクトル3Dの和", "en":"addVector3D", "naten":"addVector3D"}$ that takes a as Vector3D , b as Vector3D and returns result as Vector3D with code starting here
Assign x of a + x of b to x of result .
Assign y of a + y of b to y of result .
Assign z of a + z of b to z of result .
ending here
Declare function ${"ja":"ベクトル3Dの差", "natja":"ベクトル3Dの差", "en":"subVector3D", "naten":"subVector3D"}$ that takes a as Vector3D , b as Vector3D and returns result as Vector3D with code starting here
Assign x of a - x of b to x of result .
Assign y of a - y of b to y of result .
Assign z of a - z of b to z of result .
ending here
Declare function ${"ja":"ベクトル3Dの内積", "natja":"ベクトル3Dの内積", "en":"dotVector3D", "naten":"dotVector3D"}$ that takes a as Vector3D , b as Vector3D and returns x as double with code starting here
Assign ( x of a * x of b ) + ( y of a * y of b ) + ( z of a * z of b ) to x .
ending here
Declare function ${"ja":"ベクトル3Dの外積", "natja":"ベクトル3Dの外積", "en":"crossVector3D", "naten":"crossVector3D"}$ that takes a as Vector3D , b as Vector3D and returns result as Vector3D with code starting here
Assign ( y of a * z of b ) - ( z of a * y of b ) to x of result .
Assign ( z of a * x of b ) - ( x of a * z of b ) to y of result .
Assign ( x of a * y of b ) - ( y of a * x of b ) to z of result .
ending here
Declare function ${"ja":"ベクトル3D拡大", "natja":"ベクトル3D拡大", "en":"extendVector3D", "naten":"extendVector3D"}$ that takes a as Vector3D , x as double and returns result as Vector3D with code starting here
Assign x of a * x to x of result .
Assign y of a * x to y of result .
Assign z of a * x to z of result .
ending here
Declare function ${"ja":"ベクトル3D縮小", "natja":"ベクトル3D縮小", "en":"divVector3D", "naten":"divVector3D"}$ that takes a as Vector3D , x as double and returns result as Vector3D with code starting here
If x == 0.0 then execute code starting here
Call print with value 10000000 .
ending here
Assign x of a / x to x of result .
Assign y of a / x to y of result .
Assign z of a / x to z of result .
ending here
Declare class ${"ja":"行列4x4", "natja":"行列4x4", "en":"Matrix4x4", "naten":"Matrix4x4"}$ with members starting here
public : Declare variable element 16 in matrix as double .
Declare function Matrix4x4 with code starting here
Assign [ 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 ] to matrix .
ending here
Declare function ${"ja":"単位化", "natja":"単位化", "en":"identity", "naten":"identity"}$ with code starting here
Assign [ 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 ] to matrix .
ending here
Declare function ${"ja":"移動", "natja":"移動", "en":"translate", "naten":"translate"}$ that takes offset as Vector3D with code starting here
Initialize variable mat12 as double with element 12 in matrix .
Initialize variable mat13 as double with element 13 in matrix .
Initialize variable mat14 as double with element 14 in matrix .
Initialize variable mat15 as double with element 15 in matrix .
Assign element 0 in matrix * x of offset + element 4 in matrix * y of offset + element 8 in matrix * z of offset + mat12 to element 12 in matrix .
Assign element 1 in matrix * x of offset + element 5 in matrix * y of offset + element 9 in matrix * z of offset + mat13 to element 13 in matrix .
Assign element 2 in matrix * x of offset + element 6 in matrix * y of offset + element 10 in matrix * z of offset + mat13 to element 14 in matrix .
Assign element 3 in matrix * x of offset + element 7 in matrix * y of offset + element 11 in matrix * z of offset + mat15 to element 15 in matrix .
ending here
Declare function ${"ja":"回転", "natja":"回転", "en":"rotate", "naten":"rotate"}$ that takes axis as Vector3D , theta as double with code starting here
Call normalize of axis .
Initialize variable s as double with sin ( theta ) .
Initialize variable c as double with cos ( theta ) .
Initialize variable t as double with 1.0 - c .
Initialize variable a00 as double with element 0 in matrix .
Initialize variable a01 as double with element 1 in matrix .
Initialize variable a02 as double with element 2 in matrix .
Initialize variable a03 as double with element 3 in matrix .
Initialize variable a10 as double with element 4 in matrix .
Initialize variable a11 as double with element 5 in matrix .
Initialize variable a12 as double with element 6 in matrix .
Initialize variable a13 as double with element 7 in matrix .
Initialize variable a20 as double with element 8 in matrix .
Initialize variable a21 as double with element 9 in matrix .
Initialize variable a22 as double with element 10 in matrix .
Initialize variable a23 as double with element 11 in matrix .
Initialize variable b00 as double with x of axis * x of axis * t + c .
Initialize variable b01 as double with y of axis * x of axis * t + z of axis * s .
Initialize variable b02 as double with z of axis * x of axis * t - y of axis * s .
Initialize variable b10 as double with x of axis * y of axis * t - z of axis * s .
Initialize variable b11 as double with y of axis * y of axis * t + c .
Initialize variable b12 as double with z of axis * y of axis * t + x of axis * s .
Initialize variable b20 as double with x of axis * z of axis * t + y of axis * s .
Initialize variable b21 as double with y of axis * z of axis * t - x of axis * s .
Initialize variable b22 as double with z of axis * z of axis * t + c .
Assign a00 * b00 + a10 * b01 + a20 * b02 to element 0 in matrix .
Assign a01 * b00 + a11 * b01 + a21 * b02 to element 1 in matrix .
Assign a02 * b00 + a12 * b01 + a22 * b02 to element 2 in matrix .
Assign a03 * b00 + a13 * b01 + a23 * b02 to element 3 in matrix .
Assign a00 * b10 + a10 * b11 + a20 * b12 to element 4 in matrix .
Assign a01 * b10 + a11 * b11 + a21 * b12 to element 5 in matrix .
Assign a02 * b10 + a12 * b11 + a22 * b12 to element 6 in matrix .
Assign a03 * b10 + a13 * b11 + a23 * b12 to element 7 in matrix .
Assign a00 * b20 + a10 * b21 + a20 * b22 to element 8 in matrix .
Assign a01 * b20 + a11 * b21 + a21 * b22 to element 9 in matrix .
Assign a02 * b20 + a12 * b21 + a22 * b22 to element 10 in matrix .
Assign a03 * b20 + a13 * b21 + a23 * b22 to element 11 in matrix .
ending here
Declare function ${"ja":"拡大縮小", "natja":"拡大縮小", "en":"scale", "naten":"scale"}$ that takes x as double , y as double , z as double with code starting here
Assign element 0 in matrix * x to element 0 in matrix .
Assign element 1 in matrix * x to element 1 in matrix .
Assign element 2 in matrix * x to element 2 in matrix .
Assign element 3 in matrix * x to element 3 in matrix .
Assign element 4 in matrix * y to element 4 in matrix .
Assign element 5 in matrix * y to element 5 in matrix .
Assign element 6 in matrix * y to element 6 in matrix .
Assign element 7 in matrix * y to element 7 in matrix .
Assign element 8 in matrix * z to element 8 in matrix .
Assign element 9 in matrix * z to element 9 in matrix .
Assign element 10 in matrix * z to element 10 in matrix .
Assign element 11 in matrix * z to element 11 in matrix .
ending here
function : operator * ( a as Matrix4x4 ) => ( b as Matrix4x4 ) starting here
Assign element 0 in matrix of a * element 0 in matrix + element 1 in matrix of a * element 4 in matrix + element 2 in matrix of a * element 8 in matrix + element 3 in matrix of a * element 12 in matrix to element 0 in matrix of b .
Assign element 0 in matrix of a * element 1 in matrix + element 1 in matrix of a * element 5 in matrix + element 2 in matrix of a * element 9 in matrix + element 3 in matrix of a * element 13 in matrix to element 1 in matrix of b .
Assign element 0 in matrix of a * element 2 in matrix + element 1 in matrix of a * element 6 in matrix + element 2 in matrix of a * element 10 in matrix + element 3 in matrix of a * element 14 in matrix to element 2 in matrix of b .
Assign element 0 in matrix of a * element 3 in matrix + element 1 in matrix of a * element 7 in matrix + element 2 in matrix of a * element 11 in matrix + element 3 in matrix of a * element 15 in matrix to element 3 in matrix of b .
Assign element 4 in matrix of a * element 0 in matrix + element 5 in matrix of a * element 4 in matrix + element 6 in matrix of a * element 8 in matrix + element 7 in matrix of a * element 12 in matrix to element 4 in matrix of b .
Assign element 4 in matrix of a * element 1 in matrix + element 5 in matrix of a * element 5 in matrix + element 6 in matrix of a * element 9 in matrix + element 7 in matrix of a * element 13 in matrix to element 5 in matrix of b .
Assign element 4 in matrix of a * element 2 in matrix + element 5 in matrix of a * element 6 in matrix + element 6 in matrix of a * element 10 in matrix + element 7 in matrix of a * element 14 in matrix to element 6 in matrix of b .
Assign element 4 in matrix of a * element 3 in matrix + element 5 in matrix of a * element 7 in matrix + element 6 in matrix of a * element 11 in matrix + element 7 in matrix of a * element 15 in matrix to element 7 in matrix of b .
Assign element 8 in matrix of a * element 0 in matrix + element 9 in matrix of a * element 4 in matrix + element 10 in matrix of a * element 8 in matrix + element 11 in matrix of a * element 12 in matrix to element 8 in matrix of b .
Assign element 8 in matrix of a * element 1 in matrix + element 9 in matrix of a * element 5 in matrix + element 10 in matrix of a * element 9 in matrix + element 11 in matrix of a * element 13 in matrix to element 9 in matrix of b .
Assign element 8 in matrix of a * element 2 in matrix + element 9 in matrix of a * element 6 in matrix + element 10 in matrix of a * element 10 in matrix + element 11 in matrix of a * element 14 in matrix to element 10 in matrix of b .
Assign element 8 in matrix of a * element 3 in matrix + element 9 in matrix of a * element 7 in matrix + element 10 in matrix of a * element 11 in matrix + element 11 in matrix of a * element 15 in matrix to element 11 in matrix of b .
Assign element 12 in matrix of a * element 0 in matrix + element 13 in matrix of a * element 4 in matrix + element 14 in matrix of a * element 8 in matrix + element 15 in matrix of a * element 12 in matrix to element 12 in matrix of b .
Assign element 12 in matrix of a * element 1 in matrix + element 13 in matrix of a * element 5 in matrix + element 14 in matrix of a * element 9 in matrix + element 15 in matrix of a * element 13 in matrix to element 13 in matrix of b .
Assign element 12 in matrix of a * element 2 in matrix + element 13 in matrix of a * element 6 in matrix + element 14 in matrix of a * element 10 in matrix + element 15 in matrix of a * element 14 in matrix to element 14 in matrix of b .
Assign element 12 in matrix of a * element 3 in matrix + element 13 in matrix of a * element 7 in matrix + element 14 in matrix of a * element 11 in matrix + element 15 in matrix of a * element 15 in matrix to element 15 in matrix of b .
ending here
ending here
Declare function ${"ja":"カメラ行列", "natja":"カメラ行列", "en":"setCameraMat", "naten":"setCameraMat"}$ that takes m as Matrix4x4 , pos as Vector3D , lookAt as Vector3D , up as Vector3D and returns res as Matrix4x4 with code starting here
Initialize object newForward as Vector3D with x of lookAt - x of pos , y of lookAt - y of pos , z of lookAt - z of pos .
Initialize object a as Vector3D with 0.0 , 0.0 , 0.0 .
Assign extendVector3D ( newForward , dotVector3D ( up , newForward ) ) to a .
Initialize object newUp as Vector3D with x of up - x of a , y of up - y of a , z of up - z of a .
Call normalize of newUp .
Initialize object newRight as Vector3D with 0 , 0 , 0 .
Assign crossVector3D ( newUp , newForward ) to newRight .
Assign [ x of newRight , x of newUp , x of newForward , 0.0 , y of newRight , y of newUp , y of newForward , 0.0 , z of newRight , z of newUp , z of newForward , 0.0 , 0 - dotVector3D ( newRight , pos ) , 0 - dotVector3D ( newUp , pos ) , 0 - dotVector3D ( newForward , pos ) , 1.0 ] to matrix of m .
Return value m .
ending here
Declare function ${"ja":"視点行列3D", "natja":"視点行列3D", "en":"perspectiveMat3D", "naten":"perspectiveMat3D"}$ that takes m as Matrix4x4 , fov as double , width as double , height as double , zN as double , zF as double and returns result as Matrix4x4 with code starting here
Initialize variable PI as double with 3.14159265358979312 .
Initialize variable fov as double with 1.0 / tan ( ( 90.0 / 360.0 ) * PI ) .
Initialize variable aspectRatio as double with width / height .
Initialize variable zNear as double with zN .
Initialize variable zFar as double with zF .
Initialize variable zQ as double with zF / ( zF - zN ) .
Assign [ aspectRatio * fov , 0.0 , 0.0 , 0.0 , 0.0 , fov , 0.0 , 0.0 , 0.0 , 0.0 , zQ , 1.0 , 0.0 , 0.0 , ( 0 - zFar * zNear ) / ( zFar - zNear ) , 0.0 ] to matrix of m .
Return value m .
ending here
Declare function ${"ja":"視点行列2D", "natja":"視点行列2D", "en":"perspectiveMat2D", "naten":"perspectiveMat2D"}$ that takes m as Matrix4x4 , left as double , right as double , bottom as double , top as double , near as double , far as double and returns result as Matrix4x4 with code starting here
Assign [ 2.0 / ( right - left ) , 0.0 , 0.0 , 0.0 , 0.0 , 2.0 / ( top - bottom ) , 0.0 , 0.0 , 0.0 , 0.0 , 0 - 2.0 / ( near - far ) , 0.0 , 0 - ( right + left ) / ( right - left ) , 0 - ( top + bottom ) / ( top - bottom ) , 0 - ( far + near ) / ( far - near ) , 1.0 ] to matrix of m .
Return value m .
ending here
Declare function ${"ja":"行列4x4の積", "natja":"行列4x4の積", "en":"mulMatrix4x4", "naten":"mulMatrix4x4"}$ that takes a as Matrix4x4 , b as Matrix4x4 and returns out as Matrix4x4 with code starting here
Assign element 0 in matrix of b * element 0 in matrix of a + element 1 in matrix of b * element 4 in matrix of a + element 2 in matrix of b * element 8 in matrix of a + element 3 in matrix of b * element 12 in matrix of a to element 0 in matrix of out .
Assign element 0 in matrix of b * element 1 in matrix of a + element 1 in matrix of b * element 5 in matrix of a + element 2 in matrix of b * element 9 in matrix of a + element 3 in matrix of b * element 13 in matrix of a to element 1 in matrix of out .
Assign element 0 in matrix of b * element 2 in matrix of a + element 1 in matrix of b * element 6 in matrix of a + element 2 in matrix of b * element 10 in matrix of a + element 3 in matrix of b * element 14 in matrix of a to element 2 in matrix of out .
Assign element 0 in matrix of b * element 3 in matrix of a + element 1 in matrix of b * element 7 in matrix of a + element 2 in matrix of b * element 11 in matrix of a + element 3 in matrix of b * element 15 in matrix of a to element 3 in matrix of out .
Assign element 4 in matrix of b * element 0 in matrix of a + element 5 in matrix of b * element 4 in matrix of a + element 6 in matrix of b * element 8 in matrix of a + element 7 in matrix of b * element 12 in matrix of a to element 4 in matrix of out .
Assign element 4 in matrix of b * element 1 in matrix of a + element 5 in matrix of b * element 5 in matrix of a + element 6 in matrix of b * element 9 in matrix of a + element 7 in matrix of b * element 13 in matrix of a to element 5 in matrix of out .
Assign element 4 in matrix of b * element 2 in matrix of a + element 5 in matrix of b * element 6 in matrix of a + element 6 in matrix of b * element 10 in matrix of a + element 7 in matrix of b * element 14 in matrix of a to element 6 in matrix of out .
Assign element 4 in matrix of b * element 3 in matrix of a + element 5 in matrix of b * element 7 in matrix of a + element 6 in matrix of b * element 11 in matrix of a + element 7 in matrix of b * element 15 in matrix of a to element 7 in matrix of out .
Assign element 8 in matrix of b * element 0 in matrix of a + element 9 in matrix of b * element 4 in matrix of a + element 10 in matrix of b * element 8 in matrix of a + element 11 in matrix of b * element 12 in matrix of a to element 8 in matrix of out .
Assign element 8 in matrix of b * element 1 in matrix of a + element 9 in matrix of b * element 5 in matrix of a + element 10 in matrix of b * element 9 in matrix of a + element 11 in matrix of b * element 13 in matrix of a to element 9 in matrix of out .
Assign element 8 in matrix of b * element 2 in matrix of a + element 9 in matrix of b * element 6 in matrix of a + element 10 in matrix of b * element 10 in matrix of a + element 11 in matrix of b * element 14 in matrix of a to element 10 in matrix of out .
Assign element 8 in matrix of b * element 3 in matrix of a + element 9 in matrix of b * element 7 in matrix of a + element 10 in matrix of b * element 11 in matrix of a + element 11 in matrix of b * element 15 in matrix of a to element 11 in matrix of out .
Assign element 12 in matrix of b * element 0 in matrix of a + element 13 in matrix of b * element 4 in matrix of a + element 14 in matrix of b * element 8 in matrix of a + element 15 in matrix of b * element 12 in matrix of a to element 12 in matrix of out .
Assign element 12 in matrix of b * element 1 in matrix of a + element 13 in matrix of b * element 5 in matrix of a + element 14 in matrix of b * element 9 in matrix of a + element 15 in matrix of b * element 13 in matrix of a to element 13 in matrix of out .
Assign element 12 in matrix of b * element 2 in matrix of a + element 13 in matrix of b * element 6 in matrix of a + element 14 in matrix of b * element 10 in matrix of a + element 15 in matrix of b * element 14 in matrix of a to element 14 in matrix of out .
Assign element 12 in matrix of b * element 3 in matrix of a + element 13 in matrix of b * element 7 in matrix of a + element 14 in matrix of b * element 11 in matrix of a + element 15 in matrix of b * element 15 in matrix of a to element 15 in matrix of out .
ending here
Declare class ${"ja":"光源クラス", "natja":"光源クラス", "en":"LightClass", "naten":"LightClass"}$ with members starting here
public : Declare variable ${"ja":"座標", "natja":"座標", "en":"pos", "naten":"pos"}$ as Vector3D .
Declare variable 半径 as double .
Declare variable ambient as Vector3D .
Declare variable diffuse as Vector3D .
Declare variable specular as Vector3D .
Declare variable posLoc as short .
Declare variable radiusLoc as short .
Declare variable ambientLoc as short .
Declare variable diffuseLoc as short .
Declare variable specularLoc as short .
Declare function LightClass that takes p as Vector3D , r as double , a as Vector3D , d as Vector3D , s as Vector3D , id as int with code starting here
Assign p to pos .
Assign r to 半径 .
Assign a to ambient .
Assign d to diffuse .
Assign s to specular .
Initialize variable temp as string with "pointLights[".
Assign temp + id to temp .
Assign temp + "]"to temp .
Initialize variable posStr as string with temp + ".position".
Assign glGetUniformLocation ( 0 , posStr ) to posLoc .
Initialize variable radiusStr as string with temp + ".radius".
Assign glGetUniformLocation ( 0 , radiusStr ) to radiusLoc .
Initialize variable ambientStr as string with temp + ".ambient".
Assign glGetUniformLocation ( 0 , ambientStr ) to ambientLoc .
Initialize variable diffuseStr as string with temp + ".diffuse".
Assign glGetUniformLocation ( 0 , diffuseStr ) to diffuseLoc .
Initialize variable specularStr as string with temp + ".specular".
Assign glGetUniformLocation ( 0 , specularStr ) to specularLoc .
ending here
Declare function ${"ja":"座標設定", "natja":"座標設定", "en":"setPos", "naten":"setPos"}$ that takes coord as Vector3D with code starting here
Assign coord to pos .
ending here
ending here
Declare class ${"ja":"モデル", "natja":"モデル", "en":"Model", "naten":"Model"}$ with members starting here
public : Declare variable ${"ja":"色", "natja":"色", "en":"color", "naten":"color"}$ as Vector3D .
Declare variable ${"ja":"座標", "natja":"座標", "en":"pos", "naten":"pos"}$ as Vector3D .
Declare variable lightID as int .
Declare variable scale as Vector3D .
Declare function Model that takes data as pointer of double , num as int , c as Vector3D , p as Vector3D , s as int with code starting here
Call Vector3D of scale with value 1.0 , 1.0 , 1.0 .
Assign data to vertices .
Assign num to pointNum .
Assign c to color .
Assign p to pos .
Assign s to shaderID .
Assign ( 0 - ( 1 ) ) to lightID .
Call identity of modelMat .
Call identity of transMat .
Call identity of scaleMat .
Call identity of rotateMat .
Call identity of defaultRotateMat .
If shaderID == 0 then execute code starting here
Assign glGetUniformLocation ( 0 , "viewPos") to viewPosUniLoc .
Assign glGetUniformLocation ( 0 , "objectColor") to objectColorUniLoc .
Assign glGetUniformLocation ( 0 , "dirLight.direction") to dirLightDirUniLoc .
Assign glGetUniformLocation ( 0 , "dirLight.ambient") to dirLightAmbientUniLoc .
Assign glGetUniformLocation ( 0 , "dirLight.diffuse") to dirLightDiffuseUniLoc .
Assign glGetUniformLocation ( 0 , "dirLight.specular") to dirLightSpecularUniLoc .
ending here
If shaderID == 1 then execute code starting here
Assign glGetUniformLocation ( 1 , "lightColor") to lightColorUniLoc .
ending here