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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337
|
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable max-len */
/* eslint-disable @typescript-eslint/prefer-namespace-keyword */
//
// Type definitions for JSXGraph 1.4.x
// Project: https://jsxgraph.org
// Definitions by: David Holmes https://github.com/geometryzen
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
// Copyright 2015-2024 David Holmes, https://github.com/geometryzen
//
/**
* JSXGraph in the namespace JXG.
*/
declare namespace JXG {
/**
* Store a reference to every board in this central list.
* This will at some point replace JXG.JSXGraph.boards.
*/
export const boards: unknown;
/**
*
*/
export type CoordType = 1 | 2;
/**
* Screen coordinates in pixel relative to the upper left corner of the div element.
*/
export const COORDS_BY_SCREEN: 0x0002;
/**
* User coordinates relative to the coordinates system defined by the bounding box.
*/
export const COORDS_BY_USER: 0x0001;
/**
* A composition is a simple container that manages none or more GeometryElements.
*/
export class Composition {
/**
* @param elements A list of elements with a descriptive name for the element as the key and a reference to the element as the value of every list entry. The name is used to access the element later on.
*/
constructor(elements: { [what: string]: GeometryElement | Composition });
/**
* Adds an element to the composition container.
* @param what Descriptive name for the element, e.g. startpoint or area. This is used to access the element later on. There are some reserved names: elements, add, remove, update, prepareUpdate, updateRenderer, highlight, noHighlight, and all names that would form invalid object property names in JavaScript.
* @param element A reference to the element that is to be added. This can be another composition, too.
* @returns True, if the element was added successfully. Reasons why adding the element failed include using a reserved name and providing an invalid element.
*/
add(what: string, element: GeometryElement | Composition): boolean;
/**
* Invokes fullUpdate for every stored element with a fullUpdate method and hands over the given arguments. See JXG.GeometryElement#fullUpdate for further description, valid parameters and return values.
*/
fullUpdate(): void;
/**
* Invokes highlight for every stored element with a highlight method and hands over the given arguments. See JXG.GeometryElement#highlight for further description, valid parameters and return values.
*/
highlight(): void;
/**
* Invokes noHighlight for every stored element with a noHighlight method and hands over the given arguments. See JXG.GeometryElement#noHighlight for further description, valid parameters and return values.
*/
noHighlight(): void;
/**
* Invokes prepareUpdate for every stored element with a prepareUpdate method and hands over the given arguments. See JXG.GeometryElement#prepareUpdate for further description, valid parameters and return values.
*/
prepareUpdate(): void;
/**
* Remove an element from the composition container.
* @param what The name used to access the element.
* @returns True, if the element has been removed successfully.
*/
remove(what: string): boolean;
/**
* Invokes setAttribute for every stored element with a setAttribute method and hands over the given arguments. See JXG.GeometryElement#setAttribute for further description, valid parameters and return values.
*/
setAttribute(): void;
/**
* Invokes setParents for every stored element with a setParents method and hands over the given arguments. See JXG.GeometryElement#setParents for further description, valid parameters and return values.
*/
setParents(parents: (string | GeometryElement)[]): this;
// setParents(): void;
/**
* Invokes update for every stored element with a update method and hands over the given arguments. See JXG.GeometryElement#update for further description, valid parameters and return values.
*/
update(): void;
/**
* Invokes updateRenderer for every stored element with a updateRenderer method and hands over the given arguments. See JXG.GeometryElement#updateRenderer for further description, valid parameters and return values.
*/
updateRenderer(): void;
}
/**
* This is the Coordinates class. All members a coordinate has to provide are defined here.
*/
export class Coords {
/**
* Constructs a new Coordinates object.
* @param method The type of coordinates given by the user. Accepted values are COORDS_BY_SCREEN and COORDS_BY_USER.
* @param coordinates An array of affine coordinates.
* @param board A reference to a board.
* @param emitter If true, this coordinates object will emit update events every time the coordinates are set. Default is true.
*/
constructor(
method: CoordType,
coordinates: [z: number, x: number, y: number] | [x: number, y: number],
board: Board,
emitter?: boolean
);
/**
* Stores the board the object is used on.
*/
board: Board;
/**
* If true, this coordinates object will emit update events every time the coordinates are set.
*/
emitter: boolean;
/**
* Stores coordinates for screen view as homogeneous coordinates.
*/
scrCoords: [z: number | null, x: number, y: number];
/**
* Stores coordinates for user view as homogeneous coordinates.
*/
usrCoords: [z: number, x: number, y: number];
/**
* Copy array, either scrCoords or usrCoords. Uses slice() in case of standard arrays and set() in case of typed arrays.
* @param obj Either 'scrCoords' for COORDS_BY_SCREEN coordinates or 'usrCoords' for COORDS_BY_USER coordinates.
* @param offset The index to begin the copying from. Defaults to 0 if not given.
*/
copy(obj: "scrCoords" | "usrCoords", offset?: number): number[];
copy(obj: "scrCoords" | "usrCoords"): [number, number, number];
copy(obj: "scrCoords" | "usrCoords", offset: 0): [number, number, number];
copy(obj: "scrCoords" | "usrCoords", offset: 1): [number, number];
copy(obj: "scrCoords" | "usrCoords", offset: 2): [number];
/**
* Calculate distance of one point to another.
* @param method The type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN.
* @param coordinates The Coords object to which the distance is calculated.
* @returns The distance.
*/
distance(method: CoordType, coordinates: Coords): number;
/**
* Set coordinates by either user coordinates or screen coordinates and recalculate the other one.
* @param method The type of coordinates used here. Possible values are COORDS_BY_USER and COORDS_BY_SCREEN.
* @param coordinates An array of affine coordinates the Coords object is set to.
* @param doRound flag If true or null round the coordinates in usr2screen. This is used in smooth curve plotting. Internet Explorer needs rounded coordinates. If doRound==false we have to round in updatePathString.
* @param noevent
* @returns A reference to this coords object.
*/
setCoordinates(
method: CoordType,
coordinates: [number, number, number],
doRound?: boolean,
noevent?: boolean
): this;
/**
* Test if one of the usrCoords is NaN or the coordinates are infinite.
* @returns true if the coordinates are finite, false otherwise.
*/
isReal(): boolean;
}
/**
* Associative array that keeps track of all constructable elements registered via JXG.registerElement.
*/
export const elements: { [elementType: string]: unknown };
/**
* A JessieCode object provides an interface to the parser and stores all variables and objects used within a JessieCode script.
* The optional argument code is interpreted after initializing.
* To evaluate more code after initializing a JessieCode instance please use parse.
* For code snippets like single expressions use snippet.
*/
export class JessieCode {
/**
*
*/
board: Board;
/**
*
*/
constructor(code?: string, geonext?: boolean);
/**
*
*/
dist(p1: Point, p2: Point): number;
/**
*
*/
getElementId(id: string): GeometryElement;
/**
*
*/
L(e: Line): number;
/**
* Parses JessieCode.
* This consists of generating an AST with parser.parse, apply simplifying rules from CA and executing the ast by calling this.execute(ast).
* @param code JessieCode code to be parsed.
* @param geonext Geonext compatibility mode. Default is false.
* @param dontstore If false, the code string is stored in this.code.
*/
parse(code: string, geonext?: boolean, dontstore?: boolean): unknown;
/**
* Parses a JessieCode snippet, e.g. "3+4", and wraps it into a function, if desired.
*
* @param code A small snippet of JessieCode. Must not be an assignment.
* @param funwrap If true, the code is wrapped in a function.
* @param varname Name of the parameter(s)
* @param geonext Geonext compatibility mode. Default: false.
*/
snippet(code: string, funwrap: boolean, varname: string, geonext?: boolean): unknown;
snippet(
code: string,
funwrap: true,
varname: string,
geonext?: boolean
): (...args: number[]) => number;
/**
* operator implementation.
* @param a
* @param b
*/
sub(a: number | number[] | Point, b: number | number[] | Point): number | number[];
/**
* Implementation of the use() builtin function.
*/
use(board: Board): void;
/**
* This is used as the global V() function.
*/
V(e: Glider | Slider): number;
/**
* This is used as the global X() function.
*/
X(e: Point | Text): number;
/**
* This is used as the global Y() function.
*/
Y(e: Point | Text): number;
}
// ----------------------------------------------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------------------------------------------
/**
* Adds an event listener to a DOM element.
* @param target Reference to a DOM node.
* @param eventName The event to catch, without leading 'on', e.g. 'mousemove' instead of 'onmousemove'.
* @param handler The function to call when the event is triggered.
* @param owner The scope in which the event trigger is called.
*/
export function addEvent(
target: HTMLElement,
eventName: string,
handler: () => void,
owner: unknown
): void;
export function autoDigits(val: unknown): number;
export function autoHighlight(color: string): string;
export function bind(fn: Function, owner: unknown): Function;
export function capitalize(str: string): string;
export function clearVisPropOld(el: GeometryElement): GeometryElement;
export function clone<T>(obj: T): T;
export function cloneAndCopy<S extends object, T extends object>(obj: S, obj2: T): S | T;
export function cmpArrays(a1: unknown[], a2: unknown[]): boolean;
export function coordsArrayToMatrix(coords: unknown[], split: boolean): unknown[];
/**
* Generates an attributes object that is filled with default values from the Options object and overwritten by the user specified attributes.
* @param attributes user specified attributes
* @param options defaults options
* @param s variable number of strings, e.g. 'slider', subtype 'point1'.
*/
export function copyAttributes<T>(attributes: T, options: JXGSettings, ...s: string[]): T;
export function createEvalFunction<T>(
board: Board,
param: T[],
n: number
): (k: number) => T;
export function createFunction(
term: string | number | Function,
board: Board,
variableName: string,
evalGeonext?: boolean
): Function;
export function createHTMLSlider(
board: Board,
parents: unknown[],
attributes: SliderAttributes
): Slider;
/**
* Add something to the debug log.
* If available a JavaScript debug console is used.
* Otherwise we're looking for a HTML div with id "debug".
* If this doesn't exist, too, the output is omitted.
* @param args An arbitrary number of parameters.
*/
export function debug(...args: any[]): void;
/**
* Add something to the debug log.
* If available a JavaScript debug console is used.
* Otherwise we're looking for a HTML div with id "debug".
* If this doesn't exist, too, the output is omitted.
* @param args An arbitrary number of parameters.
*/
export function debugInt(...args: any[]): void;
/**
* Add something to the debug log.
* If available a JavaScript debug console is used.
* Otherwise we're looking for a HTML div with id "debug".
* If this doesn't exist, too, the output is omitted.
* This method adds a line of the stack trace (if available).
* @param args An arbitrary number of parameters.
*/
export function debugLine(...args: any[]): void;
/**
* Add something to the debug log.
* If available a JavaScript debug console is used.
* Otherwise we're looking for a HTML div with id "debug".
* If this doesn't exist, too, the output is omitted.
* This method adds a stack trace (if available).
* @param args An arbitrary number of parameters.
*/
export function debugWST(...args: any[]): void;
export function deepCopy<U, V>(obj1: U, obj2: V, toLower?: boolean): U | V;
export function def<T>(v: T | undefined | null, d: T): T;
/**
* This method issues a warning to the developer that the given function is deprecated and, if available, offers an alternative to the deprecated function.
* @param what Describes the function that is deprecated.
* @param replacement The replacement that should be used instead.
*/
export function deprecated(what: string, replacement?: string): void;
export function eliminateDuplicates(a: (number | string)[]): (number | string)[];
export function escapeHTML(str: string): string;
export function evalSlider(s: unknown): number;
export function evaluate(val: unknown): unknown;
/**
* Checks if a given variable is neither undefined nor null. You should not use this together with global variables!
* @param v A variable of any type.
* @param checkEmptyString If set to true, it is also checked whether v is not equal to ''. Default: false.
* @returns True, if v is neither undefined nor null.
*/
export function exists(v: unknown, checkEmptyString?: boolean): boolean;
/**
* Copy all properties of the extension object to object.
* @param obj
* @param extension
* @param onlyOwn Only consider properties that belong to extension itself, not any inherited properties. Default: false.
* @param toLower If true the keys are convert to lower case. This is needed for visProp, see JXG#copyAttributes. Default: false.
*/
export function extend(
obj: object,
extension: object,
onlyOwn?: boolean,
toLower?: boolean
): void;
export function extendConstants(
obj: object,
constants: object,
onlyOwn?: boolean,
toUpper?: boolean
): void;
export function filterElements<T>(list: T[], filter: object | Function): T[];
export function getBoardByContainerId(s: string): Board | null;
export function getCSSTransform(cPos: number[], obj: Element): number[];
export function getCSSTransformMatrix(obj: unknown): number[];
export function getDimensions(
elementId: string | object,
doc: Document
): { width: number; height: number };
export function getOffset(obj: Element): [left: number, top: number];
export function getPosition(
e?: unknown,
index?: number,
doc?: Document
): [x: number, y: number];
export function getProp(el: Element, css: string): number;
export function hex2rgb(hex: string): string;
/**
* Converts HSV color to RGB color. Based on C Code in "Computer Graphics -- Principles and Practice," Foley et al, 1996, p. 593. See also http://www.efg2.com/Lab/Graphics/Colors/HSV.htm
* @param H value between 0 and 360
* @param S value between 0.0 (shade of gray) to 1.0 (pure color)
* @param V value between 0.0 (black) to 1.0 (white)
* @returns RGB color string
*/
export function hsv2rgb(H: number, S: number, V: number): string;
export function isAndroid(): boolean;
export function isApple(): boolean;
export function isArray(v: unknown): boolean;
export function isFirefoxOS(): boolean;
export function isFunction(v: unknown): v is Function;
export function isGroup(board: Board, s: string): boolean;
export function isId(board: Board, s: string): boolean;
export function isInArray(arr: unknown[], val: unknown): boolean;
export function isInObject(obj: unknown, val: unknown): boolean;
export function isMetroApp(): boolean;
export function isMozilla(): boolean;
export function isName(board: Board, s: string): boolean;
export function isNode(): boolean;
export function isNumber(v: unknown): v is number;
export function isObject(v: unknown): boolean;
export function isPoint(v: unknown): v is Point;
export function isPoint3D(v: unknown): boolean;
export function isPointType(v: unknown): boolean;
export function isPointType3D(v: unknown): boolean;
export function isString(v: unknown): v is string;
export function isTouchDevice(): boolean;
export function isTransformationOrArray(v: unknown): boolean;
export function isWebkitAndroid(): boolean;
export function isWebkitApple(): boolean;
export function isWebWorker(): boolean;
export function keys(object: unknown, onlyOwn: boolean): string[];
export function LMS2rgb(l: number, m: number, s: number): [r: number, g: number, b: number];
export function merge<U, V>(obj1: U, obj2: V): U | V;
export function normalizePointFace(
s: string
): "x" | "o" | "[]" | "+" | "<>" | "^" | "v" | "<" | ">";
export function providePoints(
board: Board,
parents: unknown[],
attrClass: string,
attrArray: unknown[]
): JXG.Point[] | false;
/**
* This registers a new construction element to JSXGraph for the construction via the JXG.Board.create interface.
* @param element The elements name. This is case-insensitive, existing elements with the same name will be overwritten.
* @param creator The factory function that creates the GeometryElement.
*/
export function registerElement(
element: string,
creator: (
board: Board,
parents: unknown[],
attributes: Record<string, unknown>
) => GeometryElement | Composition | Array<GeometryElement>
): void;
export function registerReader(reader: Function, ext: unknown[]): void;
export function removeAllEvents(obj: unknown, type: string, owner: unknown): void;
export function removeElementFromArray<T>(ar: T[], el: T): T;
export function removeEvent(obj: unknown, type: string, fn: Function, owner: unknown): void;
export function rgb2bw(color: string): string;
export function rgb2cb(
color: string,
deficiency: "protanopia" | "deuteranopia" | "tritanopia"
): string;
export function rgb2css(
color: string | [r: number, g: number, b: number] | number,
ag: number,
ab: number
): string;
export function rgb2hex(
color: string | [r: number, g: number, b: number] | number,
ag: number,
ab: number
): string;
export function rgb2hsv(
color: string | [r: number, g: number, b: number] | number,
ag: number,
ab: number
): [h: number, s: number, v: number];
export function rgb2LMS(
color: string | [r: number, g: number, b: number] | number,
ag: number,
ab: number
): [l: number, m: number, s: number];
export function rgba2rgbo(rgba: string): [rgb: number, opacity: number];
export function rgbo2rgba(rgb: string, o: number): string;
export function rgbParser(
color: string | number[] | number,
ag?: number,
ab?: number
): [r: number, g: number, b: number];
export function sanitizeHTML(str: string, caja: boolean): string;
export function shortcut(object: unknown, fun: string): Function;
export function str2Bool(s: string): boolean;
export function supportsCanvas(): boolean;
export function supportsPointerEvents(): boolean;
/**
* Detect browser support for SVG.
*/
export function supportsSVG(): boolean;
/**
* Detect browser support for VML.
*/
export function supportsVML(): boolean;
export function swap<T>(arr: T[], i: number, j: number): T[];
export function timedChunk(
items: unknown[],
process: Function,
context: unknown,
callback: Function
): void;
export function toFixed(num: number, digits: number): string;
export function toFullscreen(wrap_id: string, jsxgraph_id: string, scale?: unknown): void;
export function toJSON(obj: unknown, noquote?: boolean): string;
export function trim(str: string): string;
export function trimNumber(str: string): string;
export function truncate(n: number, p: number): number;
export function unescapeHTML(str: string): string;
export function uniqueArray<T>(arr: T): T[];
export function useBlackWhiteOptions(board: Board): void;
export function useStandardOptions(board: Board): void;
export function warn(warning: string): void;
/**
* This is the basic class for geometry elements like points, circles and lines.
*/
export class GeometryElement {
/**
* Reference to the board associated with the element.
*/
readonly board: Board;
/**
* The string used with Board.create.
*/
readonly elType: string;
/**
* If element has a label subelement then this property will be set to true.
* Default Value: false
*/
readonly hasLabel: boolean;
/**
* True, if the element is currently highlighted.
* Default Value: false
*/
readonly highlighted: boolean;
/**
* Unique identifier for the element. Equivalent to id-attribute of renderer element.
*/
id: string;
/**
* The label subelement (if it is defined).
* @see hasLabel
*/
label?: Text;
/**
* Not necessarily unique name for the element.
*/
name: string;
/**
* Controls if updates are necessary.
*/
needsUpdate: boolean;
/**
* Stores all Intersection Objects which in this moment are not real and so hide this element.
*/
notExistingParents: unknown;
/**
* Counts the number of objects drawn as part of the trace of the element.
*/
numTraces: number;
/**
* Ids of elements on which this element depends directly are stored here.
*/
parents: string[];
/**
* Quadratic form representation of circles (and conics)
*/
quadraticform: unknown[];
/**
* Stores the SVG (or VML) rendering node for the element.
*/
rendNode: HTMLElement;
/**
* The homogeneous coordinates of the line ([C,A,B] where A*x+B*y+C*z=0).
*/
stdform: [C: number, A: number, B: number];
/**
* Subs contains the subelements, created during the create method.
*/
subs: unknown;
/**
* Stores variables for symbolic computations.
*/
symbolic: unknown;
/**
* Keeps track of all objects drawn as part of the trace of the element.
*/
traces: unknown;
/**
* Stores the transformations which are applied during update in an array
*/
transformations: unknown[];
/**
* Type of the element.
*/
type: number;
/**
* An associative array containing all visual properties.
*/
visProp: { [name: string]: unknown };
/**
* An associative array containing visual properties which are calculated from the attribute values (i.e. visProp) and from other constraints.
* An example: if an intersection point does not have real coordinates, visPropCalc.visible is set to false.
* Additionally, the user can control visibility with the attribute "visible", even by supplying a functions as value.
*/
visPropCalc: { [name: string]: unknown };
/**
*
* @param board
* @param attributes
* @param type
* @param oclass
*/
constructor(
board: Board,
attributes: GeometryElementAttributes,
type: number,
oclass: number
);
/**
* Add an element as a child to the current element. Can be used to model dependencies between geometry elements.
* @param obj The dependent object.
*/
addChild(obj: GeometryElement): void;
/**
* Adds ids of elements to the array this.parents.
* This method needs to be called if some dependencies can not be detected automatically by JSXGraph.
* For example if a function graph is given by a function which referes to coordinates of a point, calling addParents() is necessary.
* @param parents Array of elements or ids of elements. Alternatively, one can give a list of objects as parameters.
* @returns reference to the object itself.
*/
addParents(parents: unknown[]): this;
/**
* Rotate texts or images by a given degree.
* Works only for texts where JXG.Text#display equal to "internal".
* @param angle The degree of the rotation (90 means vertical text).
*/
addRotation(angle: number): void;
/**
* Get the value of the property key.
* @param key The name of the property you are looking for.
*/
getAttribute(key: string): any;
/**
* Returns the element name.
*/
getName(): string;
/**
* Hide the element. It will still exist but not be visible on the board.
* Alias for "element.setAttribute({visible: false});"
* @returns Reference to the element
*/
hide(): void;
/**
* Hides the element. It will still exist but not be visible on the board.
* Alias for JXG.GeometryElement#hide
* @returns Reference to the element
*/
hideElement(): void;
/**
* Unregister an event handler.
* For a list of possible events see documentation of the elements and objects implementing the EventEmitter interface.
* @param event
* @param handler
* @returns Reference to the object.
*/
off(event: string, handler?: (e: Event) => void): this;
/**
* Register a new event handler.
* For a list of possible events see documentation of the elements and objects implementing the EventEmitter interface.
* @param event
* @param handler
* @param context The context the handler will be called in, default is the element itself.
* @returns Reference to the object.
*/
on(event: string, handler: (e: Event) => void, context?: unknown): this;
/**
* Sets an arbitrary number of attributes.
* @param attributes An object with attributes.
*/
setAttribute(attributes: GeometryElementAttributes): this;
setDash(dash: number): void;
/**
* Show the element or hide it. If hidden, it will still exist but not be visible on the board.
* @param value true: show the element, false: hide the element
*/
setDisplayRendNode(value: boolean): this;
/**
* Sets a label and its text. If the label doesn't exist, it creates one.
*/
setLabel(label: string): void;
/**
* Updates the element's label text, strips all html.
* @param text The element label text.
*/
setLabelText(text: string): string;
/**
* Updates the element's label text and the element's attribute "name", strips all html.
* @param name The element name.
*/
setName(name: string): string;
/**
* Sets ids of elements to the array this.parents.
* First, this.parents is cleared.
* See JXG.GeometryElement#addParents.
* @param parents Array of elements or ids of elements. Alternatively, one can give a list of objects as parameters.
* @returns Reference to the element.
*/
setParents(parents: (string | GeometryElement)[]): this;
// setParents(parents: number[]): this;
/**
* Translates the object by (x, y).
* In case the element is defined by points, the defining points are translated,
* e.g. a circle constructed by a center point and a point on the circle line.
* @param method The type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN.
* @param coords coordinates in screen/user units
* @returns Reference to the element.
*/
setPosition(method: number, coords: number[]): this;
/**
* Moves an element by the difference of two coordinates.
* @param method The type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN.
* @param coords coordinates in screen/user units
* @returns Reference to the element.
*/
setPositionDirectly(method: number, coords: number[]): this;
/**
* Make the element visible.
* Alias for "element.setAttribute({visible: true});"
* @returns Reference to the element
*/
show(): void;
/**
* Make the element visible.
* Alias for JXG.GeometryElement#show
* @returns Reference to the element
*/
showElement(): void;
/**
* Snaps the element to points.
* Only works for points.
* Points will snap to the next point as defined in their properties JXG.Point#attractorDistance and JXG.Point#attractorUnit.
* Lines and circles will snap their parent points to points.
* @returns Reference to the element.
*/
snapToPoints(): this;
/**
* General update method.
* Should be overwritten by the element itself.
* Can be used sometimes to commit changes to the object.
* @returns Reference to the element.
*/
update(): this;
}
type HTMLColorString = string;
/**
* Default color palette.
*/
export const palette: {
black: string;
orange: string;
skyblue: string;
bluishgreen: string;
yellow: string;
darkblue: string;
vermillion: string;
reddishpurple: string;
blue: string;
red: string;
green: string;
purple: string;
white: string;
};
/**
* Bang Wong color palette, optimized for various type of color blindness.
*/
export const paletteWong: {
black: string;
orange: string;
skyblue: string;
bluishgreen: string;
yellow: string;
darkblue: string;
vermillion: string;
reddishpurple: string;
blue: string;
red: string;
green: string;
purple: string;
white: string;
};
/**
* Use the color scheme of JSXGraph up to version 1.3.2.
*/
export type setClassicColors = () => void;
export type Coordinate = number | string | NumberFunction | Point | Transformation;
/**
*
*/
export interface GeometryElementAttributes {
/**
* ???
*/
color?: string;
/**
* Determines the elements border-style.
* Possible values are:
* 0 for a solid line,
* 1 for a dotted line,
* 2 for a line with small dashes,
* 3 for a line with medium dashes,
* 4 for a line with big dashes,
* 5 for a line with alternating medium and big dashes and large gaps, and
* 6 for a line with alternating medium and big dashes and small gaps.
*/
dash?: number | string;
/**
* If true the element will be drawn in grey scale colors to visualize that it's only a draft.
*/
draft?: boolean | GeometryElementAttributes;
/**
* ???
*/
dragToTopOfLayer?: boolean;
/**
* The fill color of this geometry element.
*/
fillColor?: string;
/**
* Opacity for fill color.
*/
fillOpacity?: number | NumberFunction;
/**
* If true, the element is fixed and can not be dragged around.
*/
fixed?: boolean;
/**
* If true the element is fixed and can not be dragged around. The element
* will even stay at its position on zoom and moveOrigin events.
* Only free elements like points, texts, curves can be frozen.
*/
frozen?: boolean;
/**
* Gradient type.
*/
gradient?: "linear" | "radial" | null;
/**
* Angle (in radians) of the gradiant in case the gradient is of type 'linear'. If the angle is 0, the first color is on
* the left and the second color is on the right. If the angle is pi/4 the first color is on top and the second
* color at the bottom.
*
* default 0
*/
gradientAngle?: number | NumberFunction;
/**
* From the SVG specification: ‘cx’, ‘cy’ and ‘r’ define the largest (i.e., outermost) circle for the radial gradient.
* The gradient will be drawn such that the 100% gradient stop is mapped to the perimeter of this largest
* (i.e., outermost) circle. For radial gradients in canvas this is the value 'x1'. Takes a value between 0 and 1.
*
* default 0.5
*/
gradientCX?: any;
/**
* From the SVG specification: ‘cx’, ‘cy’ and ‘r’ define the largest (i.e., outermost) circle for the radial gradient.
* The gradient will be drawn such that the 100% gradient stop is mapped to the perimeter of this largest
* (i.e., outermost) circle. For radial gradients in canvas this is the value 'y1'. Takes a value between 0 and 1.
*
* default 0.5
*/
gradientCY?: any;
/**
* The gradientEndOffset attribute is a number (ranging from 0 to 1) which indicates where the second
* gradient stop is placed, see the SVG specification for more information. For linear gradients, this attribute
* represents a location along the gradient vector. For radial gradients, it represents a percentage distance
* from (fx,fy) to the edge of the outermost/largest circle.
*
* default 1.0
*/
gradientEndOffset?: any;
/**
* This attribute defines the radius of the start circle of the radial gradient. The gradient will be drawn such
* that the 0% <stop> is mapped to the perimeter of the start circle. For radial gradients in canvas this is the
* value 'r0'. Takes a value between 0 and 1.
*
* default 0.0
*/
gradientFR?: any;
/**
* ‘fx’ and ‘fy’ define the focal point for the radial gradient. The gradient will be drawn such that the 0%
* gradient stop is mapped to (fx, fy). For radial gradients in canvas this is the value 'x0'. Takes a value
* between 0 and 1.
*
* default 0.5
*/
gradientFX?: any;
/**
* y-coordinate of the circle center for the second color in case of gradient 'radial'. (The attribute fy in SVG)
* For radial gradients in canvas this is the value 'y0'. Takes a value between 0 and 1.
*
* default 0.5
*/
gradientFY?: any;
/**
* From the SVG specification: ‘cx’, ‘cy’ and ‘r’ define the largest (i.e., outermost) circle for the radial gradient.
* The gradient will be drawn such that the 100% gradient stop is mapped to the perimeter of this largest
* (i.e., outermost) circle. For radial gradients in canvas this is the value 'r1'. Takes a value between 0 and 1.
*
* default 0.5
*/
gradientR?: any;
/**
* Second color for gradient.
*
* default '#ffffff'
*/
gradientSecondColor?: any;
/**
* Opacity of second gradient color. Takes a value between 0 and 1.
*
* default 1
*/
gradientSecondOpacity?: any;
/**
* The gradientStartOffset attribute is a number (ranging from 0 to 1) which indicates where the first
* gradient stop is placed, see the SVG specification for more information. For linear gradients, this attribute
* represents a location along the gradient vector. For radial gradients, it represents a percentage distance
* from (fx,fy) to the edge of the outermost/largest circle.
*
* default 0.0
*/
gradientStartOffset?: any;
/**
*
*/
highlight?: boolean;
/**
* The fill color of the given geometry element when the mouse is pointed over it.
*/
highlightFillColor?: string;
/**
* Opacity for fill color when the object is highlighted.
*/
highlightFillOpacity?: number;
/**
* The stroke color of the given geometry element when the user moves the mouse over it.
*/
highlightStrokeColor?: string;
/**
* Opacity for stroke color when the object is highlighted.
*/
highlightStrokeOpacity?: number;
/**
* Width of the element's stroke when the mouse is pointed over it.
*/
highlightStrokeWidth?: number;
/**
* ???
* @private
* By default, an element is not a label. Do not change this.
*/
isLabel?: boolean;
/**
* ???
* Display layer which will contain the element.
*/
layer?: number;
/**
* Precision options for JSXGraph elements.
* This attributes takes either the value 'inherit' or an object of the form:
* <pre>
* precision: {
* touch: 30,
* mouse: 4,
* pen: 4
* }
* </pre>
*
*/
precision?: PrecisionOptions;
/**
* ???
* Not necessarily unique name for the element.
*/
name?: string | (() => string);
/**
* If this is set to true, the element is updated in every update
* call of the board. If set to false, the element is updated only after
* zoom events or more generally, when the bounding box has been changed.
*/
needsRegularUpdate?: boolean;
/**
* ???
*/
opacity?: number;
/**
* ???
* A private element will be inaccessible in certain environments, e.g. a graphical user interface.
*/
priv?: boolean;
/**
* Determines whether two-finger manipulation of this object may change its size.
* If set to false, the object is only rotated and translated.
*/
scalable?: boolean;
/**
* If true the element will get a shadow.
*/
shadow?: boolean;
/**
* Snaps the element or its parents to the grid. Currently only relevant for points, circles,
* and lines. Points are snapped to grid directly, on circles and lines it's only the parent
* points that are snapped
*/
snapToGrid?: boolean;
/**
* The stroke color of the given geometry element.
*/
strokeColor?: string | (() => string);
/**
* Opacity for element's stroke color.
*/
strokeOpacity?: number;
/**
* Width of the element's stroke.
*/
strokeWidth?: number | NumberFunction | string;
/**
* ???
*/
style?: number | string;
/**
* Type, used for transformations
*/
type?: string;
/**
* If true the element will be traced, i.e. on every movement the element will be copied
* to the background. Use {@link JXG.GeometryElement#clearTrace} to delete the trace elements.
*/
trace?: boolean;
/**
* Extra visual properties for traces of an element
*/
traceAttributes?: {};
/**
* Transition duration (in milliseconds) for color and opacity changes.
*/
transitionDuration?: number;
/**
* If false the element won't be visible on the board, otherwise it is shown.
*/
visible?: boolean | BooleanFunction | "inherit";
/**
* If true, a label will display the element's name.
*/
withLabel?: boolean;
}
export interface GeometryElementOptions extends GeometryElementAttributes {}
/**
* Options for the CoordsElement moveAlong method.
*/
export interface MoveAlongOptions {
/**
* A function that is called as soon as the animation is finished.
*/
callback?(): void;
/**
* If path is an array moveAlong() will interpolate the path using JXG.Math.Numerics.Neville.
* Set this flag to false if you don't want to use interpolation.
*/
interpolate?: boolean;
}
/**
* Options for the CoordsElement moveTo method.
*/
export interface MoveToOptions {
/**
* A function that is called as soon as the animation is finished.
*/
callback?(): void;
/**
* Animation effects like speed fade in and out.
* possible values are '<>' for speed increase on start and slow down at the end (default) and '--' for constant speed during the whole animation.
*/
effect?: "<>" | "--";
}
/**
* Options for the CoordsElement visit method.
*/
export interface VisitOptions {
/**
* A function that is called as soon as the animation is finished.
*/
callback?(): void;
/**
* Animation effects like speed fade in and out.
* possible values are '<>' for speed increase on start and slow down at the end (default) and '--' for constant speed during the whole animation.
* Default is '<>'.
*/
effect?: "<>" | "--";
/**
* How often this animation should be repeated.
* Default is 1.
*/
repeat?: number;
}
/**
*
*/
export class CoordsElement extends GeometryElement {
constructor(coordinates: unknown[], isLabel: boolean);
/**
* Coordinates of the element.
*/
coords: Coords;
/**
* Getter method for x, this is used by for CAS-points to access point coordinates.
*/
X(): number;
/**
* Getter method for y, this is used by for CAS-points to access point coordinates.
*/
Y(): number;
/**
*
* @param path The path the point is moved on. This can be either an array of arrays or containing x and y values of the points of the path, or an array of points, or a function taking the amount of elapsed time since the animation has started and returns an array containing a x and a y value or NaN. In case of NaN the animation stops.
* @param time The time in milliseconds in which to finish the animation
* @param options Optional settings for the animation.
* @returns Reference to itself.
*/
moveAlong(path: PointSpecification[], time: number, options?: MoveAlongOptions): this;
/**
* Starts an animated point movement towards the given coordinates where.
* The animation is done after time milliseconds.
* If the second parameter is not given or is equal to 0, setPosition() is called, see #setPosition.
* @param where Array containing the x and y coordinate of the target location.
* @param time Number of milliseconds the animation should last.
* @param options Optional settings for the animation.
* @returns Reference to itself.
*/
moveTo(where: PointSpecification, time?: number, options?: MoveToOptions): this;
/**
* Animate the point.
* @param direction: The direction the glider is animated. Can be +1 or -1.
* @param stepCount: The number of steps.
*/
startAnimation(direction: number, stepCount: number): void;
/**
* Stop animation.
*/
stopAnimation(): void;
/**
* Starts an animated point movement towards the given coordinates where.
* After arriving at where the point moves back to where it started.
* The animation is done after time milliseconds.
* @param where Array containing the x and y coordinate of the target location.
* @param time Number of milliseconds the animation should last.
* @param options Optional settings for the animation.
* @returns Reference to itself.
*/
visit(where: PointSpecification[], time?: number, options?: VisitOptions): this;
}
/**
*
*/
export interface CoordsElementAttributes extends GeometryElementAttributes {
slideObject?: GeometryElement;
}
/**
*
*/
export class Text extends CoordsElement {
/**
* @param board The board the new text is drawn on.
* @param coordinates The user coordinates of the text.
* @param attributes The visual properties and an optional name and id.
* @param content Provides the content of the text.
*/
constructor(
board: Board,
coordinates: [unknown, unknown],
attributes: TextAttributes,
content: string | StringFunction
);
getSize(): [width: number, height: number];
setText(text: string): this;
setTextJessieCode(text: string): void;
}
/**
*
*/
export interface TextAttributes extends GeometryElementAttributes {
/**
* Anchor element of the text.
* If it exists, the coordinates of the text are relative to this anchor element.
*/
anchor?: GeometryElement | null;
/**
* The horizontal alignment of the text.
* The default value is 'left'.
*/
anchorX?: AnchorX;
/**
* The vertical alignment of the text.
* The default value is 'middle'.
*/
anchorY?: AnchorY;
/**
* List of attractor elements.
* If the distance of the text is less than attractorDistance the text is made to glider of this element.
*/
attractors?: GeometryElement[];
color?: string;
/**
* The precision of the slider value displayed in the optional text.
*/
cssClass?: string;
cssDefaultStyle?: string;
cssStyle?: string;
/**
* Used to round texts given by a number.
* The default value is 2.
*/
digits?: number;
/**
* Determines the rendering method of the text.
*/
display?: "html" | "internal";
/**
* Sensitive area for dragging the text.
* Possible values are 'all', or something else.
* This may be extended to left, right, ... in the future.
*/
dragArea?: "all" | string;
/**
* The font size in pixels.
* The default value is 12.
*/
fontSize?: number;
/**
*
*/
highlightCssClass?: string;
highlightCssDefaultStyle?: string;
highlightCssStyle?: string;
/**
*
*/
isLabel?: boolean;
/**
*
*/
parse?: boolean;
/**
*
*/
rotate?: number;
/**
*
*/
snapSizeX?: number;
/**
*
*/
snapSizeY?: number;
/**
*
*/
useASCIIMathML?: boolean;
/**
*
*/
useCaja?: boolean;
/**
*
*/
useMathJax?: boolean;
}
/**
*
*/
export interface Button extends Text {
setAttribute(attributes: ButtonAttributes): this;
}
/**
*
*/
export interface ButtonAttributes extends TextAttributes {
/**
* Control the attribute "disabled" of the HTML button.
* Default Value: false.
*/
disabled?: boolean;
}
export interface Cardinalspline extends Curve {}
export interface CardinalsplineAttributes extends CurveAttributes {
createPoints?: boolean;
isArrayOfCoordinates?: boolean;
points?: PointAttributes;
}
export interface CardinalsplineOptions extends CurveOptions {
createPoints?: boolean;
isArrayOfCoordinates?: boolean;
points?: PointOptions;
}
/**
*
*/
export class Chart extends GeometryElement {
// Nothing
}
/**
*
*/
export interface ChartAttributes extends GeometryElementAttributes {
center?: PointSpecification;
chartStyle: "bar" | "pie" | "line";
colors?: string[];
fillcolor?: string | null;
gradient?: "linear";
highlightcolors?: string[] | null;
highlightonsector?: boolean;
highlightbysize?: boolean;
label?: LabelOptions;
labels?: string[];
withLines?: boolean;
}
/**
*
*/
export interface Checkbox extends Text {
/**
*
*/
rendNodeCheckbox: HTMLInputElement;
/**
*
*/
Value(): boolean;
}
/**
*
*/
export interface CheckboxAttributes extends TextAttributes {
checked?: boolean;
/**
* Control the attribute "disabled" of the HTML checkbox.
* Default value is false.
*/
disabled?: boolean;
}
/**
*
*/
export class Circle extends GeometryElement {
/**
*
*/
center: Point;
/**
*
*/
midpoint: Point;
/**
* Checks whether (x,y) is near the segment.
* @param x: Coordinate in x direction, screen coordinates.
* @param y: Coordinate in y direction, screen coordinates.
* @param start: Optional start index for search on data plots.
*/
hasPoint(x: number, y: number, start?: number): boolean;
/**
*
*/
Radius(): number;
}
/**
*
*/
export interface CircleAttributes extends GeometryElementAttributes {
/**
*
*/
center?: Point;
/**
*
*/
hasInnerPoints?: boolean;
/**
*
*/
label?: LabelOptions;
/**
*
*/
point?: Point;
}
export interface CircleOptions {
center?: PointAttributes;
fillColor?: string;
fixed?: boolean;
hasInnerPoints?: boolean;
highlight?: boolean;
highlightFillColor?: string;
highlightStrokeColor?: string;
label?: LabelOptions;
strokeColor?: string;
}
export interface Circumcircle extends Circle {}
export interface CircumcircleAttributes extends CircleAttributes {}
export interface CircumcircleOptions extends CircleOptions {
useDirection?: boolean;
}
export interface CircumcircleArc extends Arc {}
export interface CircumcircleArcAttributes extends ArcAttributes {}
export interface CircumcircleArcOptions extends ArcOptions {}
export interface CircumcircleSector extends Sector {}
export interface CircumcircleSectorAttributes extends SectorAttributes {}
export interface CircumcircleSectorOptions extends SectorOptions {
useDirection?: boolean;
point?: PointOptions;
}
export interface Comb extends Curve {}
export interface CombAttributes extends CurveAttributes {
angle?: number;
curve?: CurveAttributes;
point1?: PointAttributes;
point2?: PointAttributes;
frequency?: number;
reverse?: boolean;
width?: number;
}
export interface CombOptions extends CurveOptions {
angle?: number;
curve?: CurveOptions;
point1?: PointOptions;
point2?: PointOptions;
frequency?: number;
reverse?: boolean;
width?: number;
}
export class Complex {
absval: number;
angle: number;
imaginary: number;
isComplex: boolean;
real: number;
constructor(x?: number, y?: number);
add(c: Complex | number): this;
conj(): this;
div(c: Complex | number): this;
mult(c: Complex | number): this;
sub(c: Complex | number): this;
toString(): string;
}
/**
* Curves are the common object for function graphs, parametric curves, polar curves, and data plots.
*/
export class Curve extends GeometryElement {
/**
* Array holding the x-coordinates of a data plot.
* This array can be updated during run time by overwriting the method updateDataArray.
*/
dataX: number[];
/**
* Array holding the y-coordinates of a data plot.
* This array can be updated during run time by overwriting the method updateDataArray.
*/
dataY: number[];
/**
* Number of points on curves.
* This value changes between numberPointsLow and numberPointsHigh.
* It is set in updateCurve.
*/
numberPoints: number;
/**
* Stores a quadtree if it is required.
* The quadtree is generated in the curve updates and can be used to speed up the hasPoint method.
*/
qdt: any;
/**
* For dynamic dataplots updateCurve can be used to compute new entries for the arrays dataX and dataY.
* It is used in updateCurve.
* Default is an empty method, can be overwritten by the user.
*/
updateDataArray: (this: Curve) => void;
/**
* Add transformations to this curve.
*/
addTransform(transform: unknown): Curve;
/**
* Allocate points in the Coords array this.points
*/
allocatePoints(): void;
/**
*
*/
checkReal(): any;
/**
*
*/
generateTerm(
varname: unknown,
xterm: unknown,
yterm: unknown,
mi: unknown,
ma: unknown
): any;
/**
* Checks whether (x,y) is near the curve.
* @param x: Coordinate in x direction, screen coordinates.
* @param y: Coordinate in y direction, screen coordinates.
* @param start: Optional start index for search on data plots.
*/
hasPoint(x: number, y: number, start?: number): boolean;
/**
* Gives the default value of the right bound for the curve.
* May be overwritten in generateTerm.
*/
maxX(): number;
/**
* Gives the default value of the left bound for the curve.
* May be overwritten in generateTerm.
*/
minX(): number;
/**
* Finds dependencies in a given term and notifies the parents by adding the dependent object to the found objects child elements.
*/
notifyParents(contentStr: string): void;
/**
* Computes for equidistant points on the x-axis the values of the function.
*/
update(): this;
/**
* Computes for equidistant points on the x-axis the values of the function.
* If the mousemove event triggers this update, we use only few points.
* Otherwise, e.g. on mouseup, many points are used.
*/
updateCurve(): Curve;
/**
* Updates the data points of a parametric curve.
* This version is used if doadvancedplot is true.
*/
updateParametricCurve(mi: number, ma: number): Curve;
/**
* Updates the data points of a parametric curve.
* This version is used if doadvancedplot is false.
*/
updateParametricCurveNaive(mi: number, ma: number, len: number): Curve;
/**
* Updates the visual contents of the curve.
*/
updateRenderer(): Curve;
/**
* Applies the transformations of the curve to the given point p.
* Before using it, updateTransformMatrix has to be called.
*/
updateTransform(p: Point): Point;
/**
* The parametric function which defines the x-coordinate of the curve.
*/
X(t: number, suspendUpdate: boolean): number;
/**
* The parametric function which defines the y-coordinate of the curve.
*/
Y(t: number, suspendUpdate: boolean): number;
/**
* Treat the curve as a curve with homogeneous coordinates.
*/
Z(t: number): number;
}
/**
*
*/
export interface CurveAttributes extends GeometryElementAttributes {
curveType?: "none" | "plot" | "parameter" | "functiongraph" | "polar" | "implicit";
}
export interface CurveOptions extends GeometryElementAttributes {
curveType?:
| "none"
| "plot"
| "parameter"
| "functiongraph"
| "polar"
| "implicit"
| null;
doAdvancedPlot?: boolean;
doAdvancedPlotOld?: boolean;
handDrawing?: boolean;
label?: LabelOptions;
numberPointsHigh?: number;
numberPointsLow?: number;
plotVersion?: number;
RDPsmoothing?: boolean;
recursionDepthHigh?: number;
recursionDepthLow?: number;
useQDT?: boolean;
}
/**
*
*/
export interface Boxplot extends Curve {
setAttribute(attributes: BoxplotAttributes): this;
}
/**
*
*/
export interface BoxplotAttributes extends CurveAttributes {
/**
* Direction of the box plot.
*/
dir?: "horizontal" | "vertical";
/**
* Relative width of the maximum and minimum quantile.
*/
smallWidth?: number;
}
/**
* A grid is a set of vertical and horizontal lines to support the user with element placement.
*/
export interface Grid extends Curve {
setAttribute(attributes: GridAttributes): this;
}
export interface GridAttributes extends CurveAttributes {}
export interface GridOptions extends CurveOptions {
hasGrid?: boolean;
gridX?: number;
gridY?: number;
gridColor?: string;
gridOpacity?: number;
gridDash?: unknown;
/**
* @deprecated
*/
snapSizeX?: number;
/**
* @deprecated
*/
snapSizeY?: number;
}
/**
* In this class all group management is done.
*/
export class Group extends GeometryElement {
/**
* Creates a new instance of Group.
* @param board
* @param id Unique identifier for this object. If null or an empty string is given, an unique id will be generated by Board.
* @param name Not necessarily unique name, displayed on the board. If null or an empty string is given, an unique name will be generated.
* @param objects Array of points to add to this group.
* @param attributes Defines the visual appearance of the group.
*/
constructor(
board: Board,
id: string,
name: string,
objects: Point[],
attributes: GroupAttributes
);
/**
* Adds all points in a group to this group.
* @param group The group added to this group.
*/
addGroup(group: Group): this;
/**
* Adds ids of elements to the array this.parents. This is a copy of Element.addParents.
* @param parents Array of elements or ids of elements. Alternatively, one can give a list of objects as parameters.
*/
addParents(parents: (string | GeometryElement)[]): this;
/**
* Adds an Point to this group.
* @param object The point added to the group.
*/
addPoint(object: Point): this;
/**
* Adds multiple points to this group.
* @param objects An array of points to add to the group.
*/
addPoints(objects: Point[]): this;
/**
* Adds a point to the set of rotation points of the group. Dragging at one of these points results into a rotation of the whole group around the rotation center of the group {@see JXG.Group#setRotationCenter}.
* @param point
*/
addRotationPoint(point: Point): this;
/**
* Adds a point to the set of the scale points of the group. Dragging at one of these points results into a scaling of the whole group.
* @param point
* @param direction Restricts the directions to be scaled. Possible values are 'x', 'y', 'xy'. Default value is 'xy'.
*/
addScalePoint(point: Point, direction?: "x" | "y" | "xy"): this;
/**
* Adds a point to the set of the translation points of the group. Dragging one of these points results into a translation of the whole group.
* @param point
*/
addTranslationPoint(point: Point): this;
/**
* List of the element ids resp. values used as parents in JXG.Board#create.
*/
getParents(): string[];
/**
* Removes a point from the group.
* @param point
*/
removePoint(point: Point): this;
/**
* Removes the rotation property from a point of the group.
* @param point
*/
removeRotationPoint(point: Point): this;
/**
* Removes the scaling property from a point of the group.
* @param point
*/
removeScalePoint(point: Point): this;
/**
* Removes the translation property from a point of the group.
* @param point
*/
removeTranslationPoint(point: Point): this;
/**
* Sets ids of elements to the array this.parents. This is a copy of Element.setParents First, this.parents is cleared. See Group#addParents.
* @param parents
*/
setParents(parents: (string | GeometryElement)[]): this;
/**
* Sets the center of rotation for the group. This is either a point or the centroid of the group.
* @param object
*/
setRotationCenter(
object: Point | "centroid" | [number, number] | (() => [number, number])
): this;
/**
* Sets the rotation points of the group. Dragging at one of these points results into a rotation of the whole group around the rotation center of the group {@see JXG.Group#setRotationCenter}.
* @param objects
*/
setRotationPoints(objects: Point | Point[]): this;
/**
* Sets the center of scaling for the group. This is either a point or the centroid of the group.
* @param object
*/
setScaleCenter(
object: Point | "centroid" | [number, number] | (() => [number, number])
): this;
/**
* Sets the scale points of the group. Dragging at one of these points results into a scaling of the whole group.
* @param objects Array of JXG.Point or arbitrary number of JXG.Point elements.
* @param direction Restricts the directions to be scaled. Possible values are 'x', 'y', 'xy'. Default value is 'xy'. By default, all points of the group are translation points.
*/
setScalePoints(objects: Point | Point[], direction?: "x" | "y" | "xy"): this;
/**
* Sets the translation points of the group. Dragging at one of these points results into a translation of the whole group.
* @param objects Array of JXG.Point or arbitrary number of JXG.Point elements. By default, all points of the group are translation points.
*/
setTranslationPoints(objects: Point | Point[]): this;
/**
* Releases all elements of this group.
*/
ungroup(): this;
/**
* Sends an update to all group members. This method is called from the points' coords object event listeners and not by the board.
*/
update(): this;
setAttribute(attributes: GroupAttributes): this;
}
export interface GroupAttributes extends GeometryElementAttributes {
size?: number;
}
export interface GroupOptions extends GeometryElementAttributes {}
/**
*
*/
export class Image extends CoordsElement {
setAttribute(attributes: ImageAttributes): this;
}
export interface ImageAttributes extends CoordsElementAttributes {}
export interface ImageOptions extends CoordsElementAttributes {
attractors?: GeometryElementAttributes[];
cssClass?: string;
highlightCssClass?: string;
imageString?: string | null;
rotate?: number;
snapSizeX?: number;
snapSizeY?: number;
}
export interface Incircle extends Circle {}
export interface IncircleAttributes extends CircleAttributes {}
export interface IncircleOptions extends CircleOptions {}
export interface Inequality extends Curve {}
export interface InequalityAttributes extends CurveAttributes {}
export interface InequalityOptions extends CurveOptions {
inverse?: boolean;
}
export interface InfoboxOptions extends TextOptions {
layer?: number;
needsRegularUpdate?: boolean;
transitionDuration?: number;
}
export interface Label extends Text {}
/**
*
*/
export interface LabelOptions {
anchorX?: AnchorX;
anchorY?: AnchorY;
autoPosition?: boolean;
color?: string;
display?: "internal";
fixed?: boolean;
fontSize?: number;
highlight?: boolean;
highlightStrokeColor?: string;
highlightStrokeOpacity?: number;
layer?: number;
needsRegularUpdate?: boolean;
/**
* Label offset from the label anchor. The label anchor is determined by position.
*/
offset?: [number, number];
parse?: boolean;
/**
* Determines the label anchor.
*/
position?: "lft" | "rt" | "top" | "bot" | "ulft" | "urt" | "llft" | "lrt";
strokeColor?: string;
strokeOpacity?: number;
useMathJax?: boolean;
visible?: "inherit" | boolean;
}
export interface Legend extends GeometryElement {}
export interface LegendAttributes extends GeometryElementAttributes {}
export interface LegendOptions extends GeometryElementAttributes {
colors: string[];
labels: string[];
rowHeight?: number;
style: "horizontal" | "vertical";
}
export interface Locus extends Curve {}
export interface LocusAttributes extends CurveAttributes {}
export interface LocusOptions extends CurveOptions {
stretch?: boolean;
toOrigin?: null;
to10?: null;
translateToOrigin?: boolean;
translateTo10?: boolean;
}
export interface Mirrorelement extends GeometryElement {}
export interface MirrorelementAttributes extends GeometryElementAttributes {
point?: PointAttributes;
center?: PointAttributes;
type?: "Euclidean";
}
export interface MirrorelementOptions extends GeometryElementOptions {
point?: PointOptions;
center?: PointOptions;
type?: "Euclidean";
}
export interface Normal extends Line {}
export interface NormalAttributes extends LineAttributes {
point?: PointAttributes;
}
export interface NormalOptions extends LineOptions {
point?: PointOptions;
}
export interface Orthogonalprojection extends Point {}
export interface OrthogonalprojectionAttributes extends PointAttributes {}
export interface OrthogonalprojectionOptions extends PointOptions {}
export interface Parallel extends Line {}
export interface ParallelAttributes extends LineAttributes {
point?: PointAttributes;
}
export interface ParallelOptions extends LineOptions {
point?: PointOptions;
}
/**
* This element is used to provide a constructor for a generic conic section uniquely defined by five points.
*/
export interface Conic extends Curve {
setAttribute(attributes: ConicAttributes): this;
}
export interface ConicAttributes extends CurveAttributes {}
export interface ConicOptions extends CurveOptions {
foci?: PointOptions;
center?: PointOptions;
point?: PointOptions;
line?: LineAttributes;
}
/**
*
*/
export interface Ellipse extends Conic {
setAttribute(attributes: EllipseAttributes): this;
}
export interface EllipseAttributes extends ConicAttributes {}
/**
*
*/
export interface Hyperbola extends Conic {
setAttribute(attributes: HyperbolaAttributes): this;
}
export interface HyperbolaAttributes extends ConicAttributes {}
export interface Parabola extends Conic {
setAttribute(attributes: ParabolaAttributes): this;
}
export interface ParabolaAttributes extends ConicAttributes {}
/**
*
*/
export interface Sector extends Curve {
anglePoint: Point;
arc: Arc;
center: Point;
label: Label;
radiusPoint: Point;
selection: "minor" | "major" | "auto";
setAttribute(attributes: SectorAttributes): this;
}
export interface SectorAttributes extends CurveAttributes {}
export interface SectorOptions extends CurveOptions {
anglePoint?: PointOptions;
arc?: ArcOptions;
center?: PointOptions;
highlightOnSector?: boolean;
radiuspoint?: PointOptions;
selection?: "auto";
}
/**
* The angle element is used to denote an angle defined by three points.
* Visually it is just a Sector element with a radius not defined by the parent elements but by an attribute radius.
* As opposed to the sector, an angle has two angle points and no radius point.
* Sector is displayed if type=="sector".
* If type=="square", instead of a sector a parallelogram is displayed.
* In case of type=="auto", a square is displayed if the angle is near orthogonal.
* If no name is provided the angle label is automatically set to a lower greek letter.
*/
export interface Angle extends Sector {
/**
* Indicates a right angle.
* Invisible by default, use dot.visible: true to show.
* Though this dot indicates a right angle, it can be visible even if the angle is not a right one.
*/
dot: Point;
/**
* The point defining the radius of the angle element.
*/
point: Point;
/**
* Helper point for angles of type 'square'.
*/
pointsquare: Point;
/**
* Frees an angle from a prescribed value.
*/
free(): void;
/**
* Set an angle to a prescribed value given in radians.
* This is only possible if the third point of the angle, i.e. the anglepoint is a free point.
* @param val Number or Function which returns the size of the angle in Radians.
*/
setAngle(val: number | NumberFunction): Angle;
setAttribute(attributes: AngleAttributes): this;
/**
* Returns the value of the angle in Radians.
*/
Value(): number;
}
export interface AngleAttributes extends SectorAttributes {
arc?: ArcAttributes;
dot?: PointAttributes;
label?: LabelOptions;
/**
* Sensitivity (in degrees) to declare an angle as right angle.
* If the angle measure is inside this distance from a right angle, the orthoType of the angle is used for display.
* Default Value: 1.0
*/
orthoSensitivity?: number;
/**
* Display type of the angle field in case of a right angle.
* Default Value: 'square'
*/
orthoType?: "sector" | "sectordot" | "square" | "none";
/**
* @deprecated
*/
pointsquare?: PointAttributes;
/**
* Radius of the sector, displaying the angle.
* Default Value: 1.0
*/
radius?: number;
radiuspoint?: PointAttributes;
/**
* Display type of the angle field.
* Default Value: 'sector'
*/
type?: "sector" | "sectordot" | "square" | "none";
}
export interface AngleOptions extends SectorOptions {
arc?: ArcOptions;
dot?: PointOptions;
label?: LabelOptions;
/**
* Sensitivity (in degrees) to declare an angle as right angle.
*/
orthoSensitivity?: number;
/**
* Display type of the angle field in case of a right angle.
*/
orthoType?: "square" | "sectordot";
/**
* @deprecated
*/
pointsquare?: PointOptions;
/**
* Radius of the sector, displaying the angle.
*/
radius?: number;
radiuspoint?: PointOptions;
/**
* Display type of the angle field.
*/
type?: "sector";
}
/**
*
*/
export interface Functiongraph extends Curve {
setAttribute(attributes: FunctiongraphAttributes): this;
}
export interface FunctiongraphAttributes extends GeometryElementAttributes {
label?: LabelOptions;
}
/**
*
*/
export class Point extends CoordsElement {
constructor(board: Board, coordinates: [number, number], attributes: PointAttributes);
X(): number;
Y(): number;
Dist(point: Point): number;
/**
* Test if the point is on (is incident with) the element.
* @param element The geometry element being used as a reference point.
* @param tolerance The optional tolerance value. Defaults to Math.eps
*/
isOn(element: GeometryElement, tolerance?: number): boolean;
setAttribute(attributes: PointAttributes): this;
ref: [x: number, y: number] | (() => [x: number, y: number]);
scale: [x: number, y: number] | (() => [x: number, y: number]);
dp: [x: number, y: number] | (() => [x: number, y: number]);
}
type FaceType =
| "x"
| "cross"
| "o"
| "circle"
| "[]"
| "square"
| "+"
| "plus"
| "<>"
| "diamond"
| "<<>>"
| "diamond2"
| "^"
| "triangleUp"
| "triangleDown"
| "<"
| "triangleLeft"
| ">"
| "triangleRight";
/**
*
*/
export interface PointAttributes extends CoordsElementAttributes {
/**
* If the distance of the point to one of its attractors is less than this number the point will be a glider on this attracting element.
* If set to zero nothing happens.
* Default Value: 0
*/
attractorDistance?: number;
/**
* List of attractor elements.
* If the distance of the point is less than attractorDistance the point is made to glider of this element.
* Default Value: empty
*/
attractors?: any[];
/**
* Unit for attractorDistance and snatchDistance, used for magnetized points and for snapToPoints.
* Default Value: 'user'
*/
attractorUnit?: "screen" | "user";
/**
* ???
*/
color?: string;
/**
* There are different point styles which differ in appearance.
*/
face?: FaceType;
/**
* ???
*/
highlight?: any;
/**
* List of elements which are ignored by snapToPoints.
*/
ignoredSnapToPoints?: GeometryElement[];
/**
* Truncating rule for the digits in the infobox.
* 'auto' - done automatically.
* 'none' - no truncation.
* number: truncate after the specified number of digits with JXG.toFixed().
* Default: 'auto'
*/
infoboxDigits?: "auto" | "none" | number;
/**
* ???
*/
label?: LabelOptions;
/**
* ???
*/
radius?: number;
/**
* If true, the infobox is shown on mouse over, else not.
* Default: true.
*/
showInfobox?: boolean;
/**
* Size of a point, either in pixel or user coordinates.
* Means radius resp. half the width of a point (depending on the face).
* Default Value: 3
*/
size?: number;
/**
* Unit for size.
* Default Value: 'screen'
*/
sizeUnit?: "screen" | "user";
/**
* Defines together with `snapSizeY` the grid the point snaps on to.
* The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
* If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default x axes of the board.
* Default Value: 1
*/
snapSizeX?: number;
/**
* Defines together with `snapSizeX` the grid the point snaps on to.
* The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
* If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default y axes of the board.
* Default Value: 1
*/
snapSizeY?: number;
/**
* If set to true, the point will snap to a grid defined by `snapSizeX` and `snapSizeY`.
* Default Value: false
*/
snapToGrid?: boolean;
/**
* If set to true, the point will snap to the nearest point in distance of `attractorDistance`.
* Default Value: false
*/
snapToPoints?: boolean;
/**
* If the distance of the point to one of its attractors is at least this number the point will be released from being a glider on the attracting element.
* Default Value 0
*/
snatchDistance?: number;
/**
* This attribute was used to determined the point layout.
* It was derived from GEONExT and was replaced by Point#face and Point#size.
* Default Value: 5
*/
style?: number;
/**
* If true, the point size changes on zoom events.
* Default Value: false
*/
zoom?: boolean;
}
export interface PointOptions {
/**
*
*/
fixed: boolean;
/**
*
*/
highlight?: boolean;
/**
*
*/
snapSizeX: number;
/**
*
*/
snapSizeY: number;
/**
*
*/
snapToGrid: boolean;
}
export interface Perpendicular extends Segment {
setAttribute(attributes: PerpendicularAttributes): this;
}
export interface PerpendicularAttributes extends SegmentAttributes {}
export interface PerpendicularOptions extends SegmentOptions {}
export interface PerpendicularSegment extends Segment {}
export interface PerpendicularSegmentAttributes extends SegmentAttributes {
point?: PointAttributes;
}
export interface PerpendicularSegmentOptions extends SegmentOptions {
point?: PointOptions;
}
/**
*
*/
export class Polygon extends GeometryElement {
constructor(board: Board, vertices: unknown[], attributes: PolygonAttributes);
/**
* References to the points defining the polygon. The last vertex is the same as the first vertex.
*/
vertices: Point[];
addPoints(p: Point): this;
Area(): number;
/**
* Bounding box of a polygon.
* The bounding box is an array of four numbers:
* the first two numbers determine the upper left corner,
* the last two number determine the lower right corner of the bounding box.
*/
boundingBox(): [minX: number, maxY: number, maxX: number, minY: number];
findPoint(p: Point): number;
getTextAnchor(): unknown;
hasPoint(x: number, y: number): boolean;
hideElement(borderless?: boolean): void;
insertPoints(idx: number, p: Point): this;
intersect(polygon: Polygon): number[][];
Perimeter(): number;
remove(): void;
removePoints(p: Point): this;
setAttribute(attributes: PolygonAttributes): this;
/**
* Moves an element by the difference of two coordinates.
* @param method The type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN.
* @param coords coordinates in screen/user units
* @param oldcoords
* @returns Reference to this Polygon.
*/
setPositionDirectly(method: number, coords: unknown[], oldcoords?: unknown[]): this;
showElement(borderless?: boolean): void;
updateRenderer(): void;
}
/**
*
*/
export interface PolygonAttributes extends GeometryElementAttributes {
/**
* Attributes for the polygon border lines.
*/
borders?: LineAttributes;
/**
* If true, moving the mouse over inner points triggers hasPoint.
*/
hasInnerPoints?: boolean;
/**
* Attributes for the polygon label.
*/
label?: LabelOptions;
/**
* Attributes for the polygon vertices.
*/
vertices?: PointAttributes;
/**
* Is the polygon bordered by lines?
*/
withLines?: boolean;
}
export interface PolygonOptions extends GeometryElementAttributes {
/**
* Attributes for the polygon border lines.
*/
borders: LineOptions;
/**
* If true, moving the mouse over inner points triggers hasPoint.
*/
hasInnerPoints?: boolean;
/**
* Attributes for the polygon label.
*/
label?: LabelOptions;
/**
* Attributes for the polygon vertices.
*/
vertices?: PointAttributes;
/**
* Is the polygon bordered by lines?
*/
withLines?: boolean;
}
export interface PolygonalChain extends Polygon {}
export interface PolygonalChainAttributes extends PolygonAttributes {}
export interface PolygonalChainOptions extends PolygonOptions {}
export interface PrescribedAngleOptions extends AngleOptions {}
/**
* A glider is a point which lives on another geometric element like a line, circle, curve, turtle.
*/
export interface Glider extends Point {
/**
* When used as a glider this member stores the object, where to glide on.
* To set the object to glide on use the method makeGlider.
* DO NOT set this property directly as it will break the dependency tree.
*/
slideObject: GeometryElement;
setAttribute(attributes: GliderAttributes): this;
}
export interface GliderAttributes extends PointAttributes {}
export interface GliderOptions extends PointOptions {}
/**
* Hatch marks can be used to mark congruent lines.
*/
export interface Hatch extends Ticks {
setAttribute(attributes: HatchAttributes): this;
}
export interface HatchAttributes extends TicksAttributes {}
/**
*
*/
export interface Input extends Text {
/**
*
*/
Value(): string;
setAttribute(attributes: InputAttributes): this;
}
export interface InputAttributes extends TextAttributes {}
export interface InputOptions extends TextOptions {
disabled?: boolean;
maxlength?: number;
}
/**
*
*/
export interface Integral extends Curve {
setAttribute(attributes: IntegralAttributes): this;
}
export interface IntegralAttributes extends CurveAttributes {
baseLeft?: PointAttributes;
baseRight?: PointAttributes;
curveLeft?: CurveAttributes;
curveRight?: CurveAttributes;
}
export interface IntegralOptions extends CurveOptions {
axis?: "x" | "y";
baseLeft?: PointOptions;
baseRight?: PointOptions;
curveLeft?: CurveOptions;
curveRight?: CurveOptions;
}
export interface Normal extends Line {
setAttribute(attributes: NormalAttributes): this;
}
export interface NormalAttributes extends LineAttributes {}
/**
* A slider can be used to choose values from a given range of numbers.
*/
export interface Slider extends Glider {
/**
* End value of the slider range.
*/
readonly _smax: number;
/**
* Start value of the slider range.
*/
readonly _smin: number;
/**
* Returns the current slider value.
*/
Value(): number;
/**
* Sets the attributes of the slider.
* @param attributes The slider attributes.
* @returns The instance of the slider, allowing method chaining.
*/
setAttribute(attributes: SliderAttributes): this;
/**
* Sets the maximum value of the slider.
* @param max The maximum value.
* @returns The instance of the slider, allowing method chaining.
*/
setMax(max: number): this;
/**
* Sets the minimum value of the slider.
* @param max The minimum value.
* @returns The instance of the slider, allowing method chaining.
*/
setMin(min: number): this;
/**
* Sets the value of the slider.
* This call must be followed by a board update call.
* @param value The new value for the slider.
* @returns The instance of the slider, allowing method chaining.
*/
setValue(value: number): this;
}
export interface SliderAttributes extends GeometryElementAttributes {
/**
* Attributes for the base line of the slider.
*/
baseline?: LineAttributes;
/**
* The number of digits of the slider value displayed in the optional text.
* The default value is 2.
*/
digits?: number;
/**
* Attributes for the highlighting line of the slider.
*/
highline?: LineAttributes;
/**
* Attributes for the slider label.
*/
label?: LabelOptions;
firstArrow?: boolean | ArrowSpecification;
lastArrow?: boolean | ArrowSpecification;
/**
* If true, 'up' events on the baseline will trigger slider moves.
*/
moveOnUp?: boolean;
/**
* Attributes for first (left) helper point defining the slider position.
*/
point1?: PointAttributes;
/**
* Attributes for second (right) helper point defining the slider position.
*/
point2?: PointAttributes;
/**
* If not null, this is appended to the value and to unitLabel in the slider label.
* Possible types: string, number or function.
*/
postLabel?: string | StringFunction | number | NumberFunction | null;
/**
*
*/
showInfobox?: boolean;
/**
* Size of slider point.
* Default Value: 2
*/
size?: number;
/**
* The slider only returns integer multiples of this value, e.g. for discrete values set this property to 1.
* For continuous results set this to -1.
*/
snapWidth?: number;
/**
* If not null, this replaces the part "name = " in the slider label.
* Possible types: string, number or function.
*/
suffixLabel?: string | StringFunction | number | NumberFunction | null;
/**
* Attributes for the ticks of the base line of the slider.
*/
ticks?: TicksAttributes;
/**
* If not null, this is appended to the value in the slider label.
* Possible types: string, number or function.
*/
unitLabel?: string | StringFunction | number | NumberFunction | null;
/**
* Show slider label.
*/
withLabel?: boolean;
/**
* Show slider ticks.
*/
withTicks?: boolean;
}
export interface SliderOptions extends GeometryElementAttributes {
anchorX?: AnchorX;
anchorY?: AnchorY;
baseline?: LineOptions;
highline?: LineOptions;
display?: "html";
firstArrow?: boolean | ArrowSpecification;
lastArrow?: boolean | ArrowSpecification;
label?: LabelOptions;
moveOnUp?: boolean;
digits?: number;
point1?: PointOptions;
point2?: PointOptions;
postLabel?: string | StringFunction | number | NumberFunction | null;
showInfobox?: boolean;
size?: number;
snapWidth?: number;
step?: number;
suffixLabel?: string | StringFunction | number | NumberFunction | null;
ticks?: TicksOptions;
unitLabel?: string | StringFunction | number | NumberFunction | null;
widthOut?: number;
widthRange?: number;
withTicks?: boolean;
}
/**
*
*/
export interface Slopetriangle extends Line {
setAttribute(attributes: SlopetriangleAttributes): this;
}
export interface SlopetriangleAttributes extends LineAttributes {
/**
*
*/
baseline?: LineAttributes;
/**
*
*/
basepoint?: PointAttributes;
/**
*
*/
borders?: LineAttributes;
/**
*
*/
glider?: GliderAttributes;
/**
*
*/
label?: any;
/**
*
*/
tangent?: LineAttributes;
/**
*
*/
toppoint?: PointAttributes;
}
export interface SlopetriangleOptions extends LineOptions {
baseline?: LineOptions;
basepoint?: PointOptions;
borders?: LineOptions;
glider?: GliderOptions;
tangent?: LineOptions;
topPoint?: PointOptions;
}
/**
*
*/
export interface Stepfunction extends Curve {
setAttribute(attributes: StepfunctionAttributes): this;
}
export interface StepfunctionAttributes extends CurveAttributes {}
export interface StepfunctionOptions extends CurveOptions {}
/**
* With the element tangent the slope of a line, circle, or curve in a certain point can be visualized.
* A tangent is always constructed by a glider on a line, circle, or curve and describes the tangent in the glider point on that line, circle, or curve.
*/
export interface Tangent extends Line {
setAttribute(attributes: TangentAttributes): this;
}
export interface TangentAttributes extends LineAttributes {}
export class Line extends GeometryElement {
constructor(board: Board, p1: Point, p2: Point, attributes: LineAttributes);
/**
* Startpoint of the line.
*/
point1: Point;
/**
* Endpoint of the line.
*/
point2: Point;
/**
* Determines the angle between the positive x axis and the line.
*/
getAngle(): number;
/**
* The distance between the two points defining the line.
*/
L(): number;
/**
* Calculates the slope of the line.
*/
Slope(): number;
setAttribute(attributes: LineAttributes): this;
}
/**
*
*/
export interface LineAttributes extends GeometryElementAttributes {
/**
* Determines whether the line has an arrow at the first defining point.
*
* type=7 is the default for curves if firstArrow: true
*
* Default Value: false
*/
firstArrow?:
| boolean
| {
type?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
highlightSize?: number;
size?: number;
};
/**
* Attributes for the line label.
*/
label?: LabelOptions;
/**
* Determines whether the line has an arrow at the second defining point.
*
* type=7 is the default for curves if lastArrow: true
*
* Default Value: false
*/
lastArrow?:
| boolean
| {
type?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
highlightSize?: number;
size?: number;
};
/**
* Line endings (linecap) of a stroke element, i.e. line, circle, curve.
*
* Not available for VML renderer.
*
* Default Value: 'butt'
*/
lineCap?: "butt" | "round" | "square";
/**
* Attributes for first defining point of the line.
*/
point1?: PointAttributes;
/**
* Attributes for second defining point of the line.
*/
point2?: PointAttributes;
/**
* Defines together with Point#snapSizeY the grid the point snaps on to.
* The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
* If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default x axes of the board.
*
* Default Value: 1
*/
snapSizeX?: number;
/**
* Defines together with Point#snapSizeX the grid the point snaps on to.
* The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
* If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default y axes of the board.
*
* Default Value: 1
*/
snapSizeY?: number;
/**
* If set to true, the point will snap to a grid defined by Point#snapSizeX and Point#snapSizeY.
*
* Default Value: false
*/
snapToGrid?: boolean;
/**
* Determines whether the line is drawn beyond the first defining point.
*
* If true, line stretches infinitely in direction of its first point. Otherwise it ends at point1.
*
* Default Value: true
*/
straightFirst?: boolean;
/**
* Determines whether the line is drawn beyond the second defining point.
*
* If true, line stretches infinitely in direction of its second point. Otherwise it ends at point2.
*
* Default Value: true
*/
straightLast?: boolean;
/**
* Attributes for ticks of the line.
*/
ticks?: TicksOptions;
/**
* If set to true and Line#firstArrow is set to true, the arrow head will just touch the circle line of the start point of the line.
*
* Default Value: false
*/
touchFirstPoint?: boolean;
/**
* If set to true and Line#lastArrow is set to true, the arrow head will just touch the circle line of the start point of the line.
*
* Default Value: false
*/
touchLastPoint?: boolean;
}
export interface LineOptions extends GeometryElementAttributes {
/**
* Determines whether the line has an arrow at the first defining point.
*/
firstArrow?:
| boolean
| {
type?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
highlightSize?: number;
size?: number;
};
/**
*
*/
fixed?: boolean;
/**
*
*/
label?: LabelOptions;
/**
* Determines whether the line has an arrow at the second defining point.
*/
lastArrow?:
| boolean
| {
type?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
highlightSize?: number;
size?: number;
};
/**
* Line endings (linecap) of a stroke element, i.e. line, circle, curve.
*
* Not available for VML renderer.
*
* Default Value: 'butt'
*/
lineCap?: "butt" | "round" | "square";
/**
*
*/
point1?: PointOptions;
/**
*
*/
point2?: PointOptions;
/**
*
*/
snapSizeX?: number;
/**
*
*/
snapSizeY?: number;
/**
* Determines whether the line is drawn beyond the first defining point.
*/
straightFirst?: boolean;
/**
* Determines whether the line is drawn beyond the second defining point.
*/
straightLast?: boolean;
/**
*
*/
ticks?: TicksOptions;
/**
*
*/
touchFirstPoint?: boolean;
/**
*
*/
touchLastPoint?: boolean;
/**
*
*/
margin?: number;
/**
*
*/
withTicks?: boolean;
}
/**
*
*/
export interface Arc extends Curve {
/**
* The point defining the arc's angle.
*/
anglepoint: Point;
/**
* Center of the arc.
*/
center: Point;
/**
* Point defining the arc's radius.
*/
radiuspoint: Point;
/**
* Checks whether (x,y) is within the sector defined by the arc.
* x: Coordinate in x direction, screen coordinates.
* y: Coordinate in y direction, screen coordinates.
*/
hasPointSector(x: number, y: number): boolean;
/**
* Determines the arc's current radius.
* i.e. the distance between center and radiuspoint.
*/
Radius(): number;
setAttribute(attributes: ArcAttributes): this;
/**
* Returns the length of the arc.
*/
Value(): number;
}
export interface ArrowSpecification {
type?: number;
highlightSize?: number;
size?: number;
}
/**
*
*/
export interface ArcAttributes extends CurveAttributes {
anglePoint?: PointAttributes;
center?: PointAttributes;
firstArrow?: ArrowSpecification | boolean | (() => ArrowSpecification | boolean);
hasInnerPoints?: boolean;
label?: LabelOptions;
lastArrow?: ArrowSpecification | boolean | (() => ArrowSpecification | boolean);
radiuspoint?: PointAttributes;
selection?: "auto" | "major" | "minor";
useDirection?: boolean;
}
export interface ArcOptions extends CurveOptions {
anglePoint?: PointAttributes;
center?: PointAttributes;
firstArrow?: ArrowSpecification | boolean | (() => ArrowSpecification | boolean);
hasInnerPoints?: boolean;
label?: LabelOptions;
lastArrow?: ArrowSpecification | boolean | (() => ArrowSpecification | boolean);
radiuspoint?: PointAttributes;
selection?: "auto" | "major" | "minor";
useDirection?: boolean;
}
/**
*
*/
export interface Arrow extends Line {
setAttribute(attributes: ArrowAttributes): this;
}
export interface ArrowAttributes extends GeometryElementAttributes {
firstArrow?: boolean | ArrowSpecification;
lastArrow?: boolean | ArrowSpecification;
}
export interface ArrowOptions extends GeometryElementOptions {}
/**
*
*/
export interface Axis extends Line {
/**
*
*/
defaultTicks: Ticks;
setAttribute(attributes: AxisAttributes): this;
}
export interface AxisAttributes extends GeometryElementAttributes {
/**
* Attributes for the axis label.
*/
label?: LabelOptions;
lastArrow?: boolean | ArrowSpecification;
margin?: number;
/**
* Attributes for the first point on the axis.
*/
point1?: PointAttributes;
/**
* Attributes for the second point on the axis.
*/
point2?: PointAttributes;
straightFirst?: boolean;
straightLast?: boolean;
/**
* Attributes for ticks of the axis.
*/
ticks?: TicksOptions;
/**
* Show / hide ticks.
* @deprecated Use "ticks: {visible: false}"
*/
withTicks?: boolean;
}
export interface Bisector extends Line {}
export interface BisectorAttributes extends LineAttributes {
point?: PointAttributes;
}
export interface Intersection extends Point {
setAttribute(attributes: IntersectionAttributes): this;
}
export interface IntersectionAttributes extends PointAttributes {}
export interface IntersectionOptions extends PointOptions {}
export interface Metapostspline extends Curve {}
export interface MetapostsplineAttributes extends CurveAttributes {}
export interface Midpoint extends Point {
setAttribute(attributes: MidpointAttributes): this;
}
export interface MidpointAttributes extends PointAttributes {}
export interface MinorArc extends Arc {
setAttribute(attributes: MinorArcAttributes): this;
}
export interface MinorArcAttributes extends ArcAttributes {}
/**
* A mirror element is determined by the reflection of a given point across another given point.
*/
export interface Mirroelement extends GeometryElement {}
export interface MirrorelementAttributes extends GeometryElementAttributes {}
/**
* A reflected point is given by a point and a line.
* It is determined by the reflection of the given point against the given line.
*/
export interface Reflection extends Point {
setAttribute(attributes: ReflectionAttributes): this;
}
export interface ReflectionAttributes extends PointAttributes {}
export interface ReflectionOptions extends PointOptions {}
export interface RegularPolygon extends Polygon {}
export interface RegularPolygonAttributes extends PolygonAttributes {}
export interface RegularPolygonOptions extends PolygonOptions {}
/**
*
*/
export interface Riemannsum extends Curve {
/**
*
*/
Value(): number;
setAttribute(attributes: RiemannsumAttributes): this;
}
export interface RiemannsumAttributes extends CurveAttributes {}
export interface RiemannsumOptions extends CurveOptions {}
export interface Sector extends Curve {
setAttribute(attributes: SectorAttributes): this;
}
export interface SectorAttributes extends CurveAttributes {}
/**
*
*/
export interface Segment extends Line {
/**
* Checks whether (x,y) is near the segment.
* @param x: Coordinate in x direction, screen coordinates.
* @param y: Coordinate in y direction, screen coordinates.
* @param start: Optional start index for search on data plots.
*/
hasPoint(x: number, y: number, start?: number): boolean;
setAttribute(attributes: SegmentAttributes): this;
}
export interface SegmentAttributes extends LineAttributes {}
export interface SegmentOptions extends LineOptions {}
export interface Semicircle extends Arc {}
export interface SemicircleAttributes extends ArcAttributes {}
export interface SemicircleOptions extends ArcOptions {}
/**
*
*/
export class Ticks extends GeometryElement {
constructor(line: Line, ticks: number | unknown[], attributes: TicksAttributes);
/**
* Equidistant ticks. Distance is defined by `ticksFunction`.
*/
equidistant: boolean;
/**
* Array of fixed ticks.
*/
fixedTicks: number[] | null;
/**
* To ensure the uniqueness of label ids this counter is used.
*/
labelCounter: number;
/**
* Array where the labels are saved.
*/
labels: Label[];
/**
* The line the ticks belong to.
*/
line: Line;
/**
* Least distance between two ticks, measured in pixels.
*/
minTicksDistance: number;
/**
* Stores the ticks coordinates as an array of length 3.
*
* The first two entries of the array are path coordinates in screen
* coordinates of the tick (arrays of length 2). The 3rd entry is true if
* the tick is a major tick, otherwise false.
*
* If the tick is outside of the canvas, the return array is empty.
*/
ticks: Array<[[x1: number, x2: number], [y1: number, y2: number], boolean]>;
/**
* Distance between two major ticks in user coordinates
*/
ticksDelta: number;
/**
* A function calculating ticks delta depending on the ticks number.
*/
ticksFunction: () => number;
setAttribute(attributes: TicksAttributes): this;
}
/**
*
*/
export interface TicksAttributes extends GeometryElementAttributes {
/**
*
*/
anchor?: "left" | "middle" | "right";
/**
*
*/
beautifulScientificTickLabels?: boolean;
/**
*
*/
// defaultDistance?: number;
/**
*
*/
drawLabels?: boolean;
/**
*
*/
drawZero?: boolean;
face?: "|" | "<" | ">";
/**
*
*/
generateLabelText?:
| ((labeled: Coords, center: Coords, value: null | Number | String) => string)
| null;
/**
*
*/
generateLabelValue?: ((labeled: Coords, center: Coords) => string) | null;
/**
*
*/
includeBoundaries?: boolean;
/**
*
*/
insertTicks?: boolean;
/**
*
*/
label?: LabelOptions;
/**
*
*/
labels?: string[];
/**
*
*/
majorHeight?: number;
/**
*
*/
maxLabelLength?: number;
/**
*
*/
minTicksDistance?: number;
/**
*
*/
minorHeight?: number;
/**
*
*/
minorTicks?: number;
/**
*
*/
digits?: number;
/**
*
*/
scale?: number;
/**
*
*/
scaleSymbol?: string;
/**
*
*/
tickEndings?: number[];
/**
*
*/
ticksDistance?: number;
/**
*
*/
type?: "line" | "string";
/**
*
*/
useUnicodeMinus?: boolean;
}
export interface TicksOptions extends GeometryElementOptions {
anchor?: "left" | "middle" | "right";
beautifulScientificTickLabels?: boolean;
// defaultDistance?: number;
drawLabels?: boolean;
drawZero?: boolean;
face?: "|" | "<" | ">";
fillColor?: string;
generateLabelText?:
| ((one: Coords, two: Coords, value: null | Number | String) => void)
| null;
generateLabelValue?: ((labeled: Coords, center: Coords) => string) | null;
highlightFillColor?: string;
highlightStrokeColor?: string;
includeBoundaries?: boolean;
insertTicks?: boolean;
label?: LabelOptions;
labels?: any[];
majorHeight?: number;
maxLabelLength?: number;
minorHeight?: number;
minorTicks?: number;
minTicksDistance?: number;
needsRegularUpdate?: boolean;
digits?: number;
scale?: number;
scaleSymbol?: string;
strokeColor?: string;
strokeOpacity?: number;
strokeWidth?: number;
ticksDistance?: number;
tickEndings?: [number, number];
/**
*
*/
ticksPerLabel?: number;
// TODO: linear used in JSXGraph workshop Dec 16, 2020.
type?: "line" | "linear" | "polar";
useUnicodeMinus?: boolean;
visible?: "inherit" | boolean;
}
/**
*
*/
export interface Tapemeasure extends Segment {
setAttribute(attributes: TapemeasureAttributes): this;
}
export interface TapemeasureAttributes extends LineAttributes {
label?: LabelOptions;
point1?: PointAttributes;
point2?: PointAttributes;
digits?: number;
ticks?: TicksOptions;
withLabel?: boolean;
withTicks?: boolean;
}
export interface TapemeasureOptions extends LineOptions {
digits?: number;
}
export interface Tracecurve extends Curve {}
export interface TracecurveAttributes extends CurveAttributes {
numberPoints?: number;
}
export interface TracecurveOptions extends CurveOptions {
numberPoints?: number;
}
export type TransformationType =
| "generic"
| "reflect"
| "rotate"
| "scale"
| "shear"
| "translate";
/**
* A transformation consists of a 3x3 matrix, i.e. it is a projective transformation.
*/
export class Transformation extends GeometryElement {
/**
* @param board The board the new circle is drawn on.
* @param type Can be 'translate', 'scale', 'reflect', 'rotate', 'shear', 'generic'
* @param params The parameters depend on the transformation type.
*/
constructor(board: Board, type: TransformationType, params: unknown);
/**
* Transform a GeometryElement: First, the transformation matrix is updated, then do the matrix-vector-multiplication.
* @param p element which is transformed
*/
private apply(p: GeometryElement): unknown[];
/**
* Applies a transformation once to a GeometryElement or an array of elements.
* If it is a free point, then it can be dragged around later and will overwrite the transformed coordinates.
* @param p
*/
applyOnce(p: GeometryElement | GeometryElement[]): void;
/**
* Binds a transformation to a GeometryElement or an array of elements.
* In every update of the GeometryElement(s), the transformation is executed.
* That means, in order to immediately apply the transformation, a call of board.update() has to follow.
* @param p JXG.Object or array of JXG.Object to which the transformation is bound to.
*/
bindTo(p: GeometryElement | Point[]): void;
/**
* Combine two transformations to one transformation.
* This only works if both of transformation matrices consist solely of numbers, and do not contain functions.
* Multiplies the transformation with a transformation t from the left. i.e. (this) = (t) join (this)
* @param t Transformation which is the left multiplicand
* @returns the transformation object.
*/
melt(t: Transformation): Transformation;
/**
* Empty method. Unused.
* @param term Key-value pairs of the attributes.
*/
setAttribute(term: TransformationAttributes): this;
/**
* Set the transformation matrix for different types of standard transforms.
* @param board
* @param type Transformation type, possible values are 'translate', 'scale', 'reflect', 'rotate', 'shear', 'generic'.
* @param params Parameters for the various transformation types.
* @param x Shift vector (number or function) in case of 'translate'.
* @param y Shift vector (number or function) in case of 'translate'.
* @param scale_x Scale vector (number or function) in case of 'scale'.
* @param scale_y Scale vector (number or function) in case of 'scale'.
*/
setMatrix(
board: Board,
type: TransformationType,
params: unknown[],
x: NumberOrFunction,
y: NumberOrFunction,
scale_x: NumberOrFunction,
scale_y: NumberOrFunction
): void;
/**
* Updates the numerical data for the transformation, i.e. the entry of the subobject matrix.
*/
update(): this;
}
/**
*
*/
export interface TransformationAttributes {
type: TransformationType;
}
/**
*
*/
export class Turtle extends GeometryElement {
/**
* Constructs a new Turtle object.
* @param board The board the new turtle is drawn on.
* @param parents Start position and start direction of the turtle. Possible values are [x, y, angle] [[x, y], angle] [x, y] [[x, y]].
* @param attributes Attributes to change the visual properties of the turtle object All angles are in degrees.
*/
constructor(board: Board, parents: unknown[], attributes: TurtleAttributes);
/**
*
*/
pos: number[];
/**
* Move the turtle backwards.
*/
back(distance: number): Turtle;
/**
* Alias for back.
*/
bk(distance: number): Turtle;
/**
* Removes the turtle curve from the board.
* The turtle stays in its position.
*/
clean(): Turtle;
/**
* Removes the turtle completely and resets it to its initial position and direction.
*/
clearScreen(): Turtle;
/**
* Alias for clearScreen.
*/
cs(): Turtle;
/**
* Alias for forward.
*/
fd(distance: number): Turtle;
/**
* Move the turtle forward.
*/
forward(distance: number): Turtle;
/**
* Checks whether (x,y) is near the curve.
* x: Coordinate in x direction, screen coordinates.
* y: Coordinate in y direction, screen coordinates.
*/
hasPoint(x: number, y: number): boolean;
/**
* Sets the visibility of the turtle head to false.
*/
hideTurtle(): Turtle;
/**
* Moves the turtle to position [0,0].
*/
home(): Turtle;
/**
* Alias for hideTurtle.
*/
ht(): Turtle;
/**
* Rotate the turtle direction to the left.
* angle: angle of the rotation in degrees.
*/
left(angle: number): Turtle;
/**
* Rotates the turtle into a new direction.
* There are two possibilities:
* If a number is given, it is interpreted as the new direction to look to.
* If an array consisting of two numbers is given, target is used as a pair coordinates.
*/
lookTo(target: number | [number, number]): Turtle;
/**
* Alias for left.
*/
lt(angle: number): Turtle;
/**
* Gives the upper bound of the parameter if the turtle is treated as parametric curve.
*/
maxX(): number;
/**
* Gives the lower bound of the parameter if the turtle is treated as parametric curve.
*/
minX(): number;
/**
* Moves the turtle to a given coordinate pair.
* The direction is not changed.
*/
moveTo(target: [number, number]): Turtle;
/**
* Alias for penDown.
*/
pd(): Turtle;
/**
* Pen down, continues visible drawing.
*/
penDown(): Turtle;
/**
* Pen up, stops visible drawing.
*/
penUp(): Turtle;
/**
* Alias for popTurtle.
*/
pop(): Turtle;
/**
* Gets the last position of the turtle on the stack,
* sets the turtle to this position and removes this position from the stack.
*/
popTurtle(): Turtle;
/**
* Alias for penUp.
*/
pu(): Turtle;
/**
* Alias for pushTurtle.
*/
push(): Turtle;
/**
* Pushes the position of the turtle on the stack.
*/
pushTurtle(): Turtle;
/**
* Alias for right.
*/
rt(angle: number): Turtle;
/**
* Rotate the turtle direction to the right.
* @param angle angle of the rotation in degrees.
* @returns pointer to the turtle object.
*/
right(angle: number): Turtle;
/**
* Sets properties of the turtle.
* Sets the property for all curves of the turtle in the past and in the future.
*/
setAttribute(attributes: TurtleAttributes): this;
/**
* Sets the highlight pen color.
* Affects only the future turtle.
*/
setHighlightPenColor(color: string): Turtle;
/**
* Sets the pen color.
* Affects only the future turtle.
*/
setPenColor(color: string): Turtle;
/**
* Sets the pen size.
* Affects only the future turtle.
*/
setPenSize(size: number): Turtle;
/**
* Moves the turtle without drawing to a new position.
*/
setPos(x: number, y: number): Turtle;
/**
* Alias for setAttribute.
*/
setProperty(attributes: TurtleAttributes): this;
/**
* Sets the visibility of the turtle head to true.
*/
showTurtle(): Turtle;
/**
* Alias for showTurtle.
*/
st(): Turtle;
/**
* If t is not supplied the x-coordinate of the turtle is returned.
* Otherwise the x-coordinate of the turtle curve at position t is returned.
*/
X(t?: number): number;
/**
* If t is not supplied the y-coordinate of the turtle is returned.
* Otherwise the y-coordinate of the turtle curve at position t is returned.
*/
Y(t?: number): number;
/**
* Returns the z-coordinate of the turtle position.
*/
Z(t: number): number;
}
/**
* Attributes to change the visual properties of the turtle object.
* All angles are in degrees.
*/
export interface TurtleAttributes extends GeometryElementAttributes {
/**
*
*/
arrow?: ArrowAttributes;
}
export interface TurtleOptions extends GeometryElementOptions {
arrow?: ArrowOptions;
}
export interface Circle3DAttributes extends GeometryElementAttributes {}
export interface Curve3DAttributes extends CurveAttributes {}
export interface Curve3D extends Curve {}
export interface Line3DAttributes extends LineAttributes {}
export interface Line3D extends Line {}
export interface Plane3DAttributes extends GeometryElementAttributes {
mesh3d?: {
visible?: boolean;
};
}
export interface Plane3D extends GeometryElement {}
export interface Point3DAttributes extends GeometryElementAttributes {}
export interface Point3D {
X(): number;
Y(): number;
Z(): number;
}
export interface Sphere3DAttributes extends GeometryElementAttributes {}
export interface View3DAttributes extends GeometryElementAttributes {
axesPosition?: "center";
xAxis?: Line3DAttributes;
xPlaneFront?: Plane3DAttributes;
xPlaneFrontYAxis?: Plane3DAttributes;
xPlaneFrontZAxis?: Plane3DAttributes;
xPlaneRear?: Plane3DAttributes;
xPlaneRearYAxis?: Plane3DAttributes;
xPlaneRearZAxis?: Plane3DAttributes;
yAxis?: Line3DAttributes;
yPlaneFront?: Plane3DAttributes;
yPlaneFrontXAxis?: Plane3DAttributes;
yPlaneFrontZAxis?: Plane3DAttributes;
yPlaneRear?: Plane3DAttributes;
yPlaneRearXAxis?: Plane3DAttributes;
yPlaneRearZAxis?: Plane3DAttributes;
zAxis?: Line3DAttributes;
zPlaneFront?: Plane3DAttributes;
zPlaneFrontXAxis?: Plane3DAttributes;
zPlaneFrontYAxis?: Plane3DAttributes;
zPlaneRear?: Plane3DAttributes;
zPlaneRearXAxis?: Plane3DAttributes;
zPlaneRearYAxis?: Plane3DAttributes;
}
export class View3D extends GeometryElement {
/**
* Constructs a new View3D object.
* @param board
* @param parents
* @param attributes
*/
constructor(board: Board, parents: unknown[], attributes: View3DAttributes);
create(
elementType: "circle3d",
parents: unknown[],
attributes?: Circle3DAttributes
): Circle3D;
create(
elementType: "curve3d",
parents: unknown[],
attributes?: Curve3DAttributes
): Curve3D;
create(
elementType: "functiongraph3d",
parents: unknown[],
attributes?: unknown
): unknown;
create(
elementType: "line3d",
parents: unknown[],
attributes?: Line3DAttributes
): Line3D;
create(
elementType: "parametricsurface3d",
parents: unknown[],
attributes?: unknown
): unknown;
create(
elementType: "plane3d",
parents: unknown[],
attributes?: Plane3DAttributes
): Plane3D;
create(
elementType: "point3d",
parents: unknown[],
attributes?: Point3DAttributes
): Point3D;
create(
elementType: "polygon3d",
parents: unknown[],
attributes?: Polygon3DAttributes
): Polygon3D;
create(
elementType: "sphere3d",
parents: unknown[],
attributes?: Sphere3DAttributes
): Sphere3D;
add(el: unknown): void;
update(): this;
updateRenderer(): this;
project3DTo2D(x: number, y: number, z: number): [number, number, number];
project3DToCube(c3d: number[]): number[];
intersectionLineCube(p: number[], d: number[], r: number): number;
isInCube(q: number[]): boolean;
intersectionPlanePlane(plane1: unknown, plane2: unknown, d?: number): unknown[];
getMesh(
X: unknown,
Y: unknown,
Z: unknown,
interval_u: unknown,
interval_v: unknown
): [unknown[], unknown[]];
animateAzimuth(): void;
stopAzimuth(): void;
}
/**
*
*/
type ElementType =
| 'angle'
| 'arc'
| 'arrow'
| 'arrowparallel'
| 'axis'
| 'bisector'
| 'bisectorlines'
| 'boxplot'
| 'button'
| 'cardinalspline'
| 'chart'
| 'checkbox'
| 'circle'
| 'circle3d'
| 'circumcenter'
| 'circumcircle'
| 'circumcirclearc'
| 'circumcirclesector'
| 'comb'
| 'conic'
| 'curve'
| 'curve3d'
| 'curvedifference'
| 'curveintersection'
| 'curveunion'
| 'derivative'
| 'ellipse'
| 'foreignobject'
| 'functiongraph'
| 'functiongraph3d'
| 'glider'
| 'grid'
| 'group'
| 'hatch'
| 'hyperbola'
| 'image'
| 'incenter'
| 'incircle'
| 'inequality'
| 'input'
| 'integral'
| 'intersection'
| 'intersectioncircle3d'
| 'intersectionline3d'
| 'label'
| 'legend'
| 'line'
| 'line3d'
| 'locus'
| 'majorarc'
| 'majorsector'
| 'metapostspline'
| 'midpoint'
| 'minorarc'
| 'minorsector'
| 'mirrorelement'
| 'mirrorpoint'
| 'nonreflexangle'
| 'normal'
| 'orthogonalprojection'
| 'otherintersection'
| 'parabola'
| 'parallel'
| 'parallelpoint'
| 'parametricsurface3d'
| 'perpendicular'
| 'perpendicularpoint'
| 'perpendicularsegment'
| 'plot'
| 'point'
| 'point3d'
| 'polygon3d'
| 'polarline'
| 'polepoint'
| 'polygon'
| 'polygonalchain'
| 'radicalaxis'
| 'reflection'
| 'reflexangle'
| 'regularpolygon'
| 'riemannsum'
| 'sector'
| 'segment'
| 'semicircle'
| 'slider'
| 'slopetriangle'
| 'sphere3d'
| 'spline'
| 'stepfunction'
| 'tangent'
| 'tapemeasure'
| 'text'
| 'ticks'
| 'tracecurve'
| 'transform'
| 'turtle'
| 'view3d';
/**
* GEONExT syntax for coordinates.
*/
type GEONExT = string;
/**
*
*/
type HandlerFunction = () => any;
/**
*
*/
type ImageURL = string;
/**
*
*/
type BooleanFunction = () => boolean;
/**
*
*/
type NumberFunction = () => number;
/**
*
*/
type NumberOrFunction = number | NumberFunction;
/**
*
*/
type BorderSpecification = NumberOrFunction;
/**
*
*/
type CurveFunction = (x: number) => number;
/**
*
*/
type CoordSpecification = NumberOrFunction | GEONExT;
/**
*
*/
type PointSpecification = CoordSpecification[] | Point | (() => Point) | GEONExT;
/**
*
*/
type StringFunction = () => string;
/**
*
*/
type StringOrFunction = string | StringFunction;
type RiemannSumType =
| "left"
| "right"
| "middle"
| "lower"
| "upper"
| "random"
| "simpson"
| "trapezoidal";
type RiemannSumTypeFunction = () => RiemannSumType;
type RiemannSumTypeOrFunction = RiemannSumType | RiemannSumTypeFunction;
type AnchorX = "auto" | "left" | "middle" | "right";
type AnchorY = "auto" | "top" | "middle" | "bottom";
export interface Axis {
name: string;
ticks: {
anchorX?: AnchorX;
anchorY?: AnchorY;
label?: LabelOptions;
drawZero?: boolean;
visible?: "inherit";
};
}
export interface DefaultAxes {
x: AxisAttributes;
y: AxisAttributes;
}
/**
*
*/
export class Board {
/**
*
* @param event
* @param handler
* @param context
*/
addEvent(event: string, handler: (evt: PointerEvent) => void, context?: {}): {};
/**
*
*/
animationObjects: unknown;
/**
*
*/
attr: BoardAttributes;
/**
*
*/
BOARD_MODE_DRAG: number;
/**
*
*/
BOARD_MODE_MOVE_ORIGIN: number;
/**
*
*/
BOARD_MODE_NONE: number;
/**
*
*/
BOARD_MODE_ZOOM: number;
/**
*
*/
BOARD_QUALITY_HIGH: number;
/**
*
*/
BOARD_QUALITY_LOW: number;
/**
*
*/
canvasHeight: number;
/**
*
*/
canvasWidth: number;
/**
* The HTML id of the HTML element containing the board.
*/
container: string;
/**
* The HTML element containing the board.
*/
containerObj: HTMLDivElement;
/**
* Cached result of getCoordsTopLeftCorner for touch/mouseMove-Events to save some DOM operations.
*/
cPos: unknown[];
/**
* The current color blindness deficiency.
* If color blindness is not emulated at the moment, it's value is 'none'.
*/
currentCBDef: "none" | string;
/**
*
*/
defaultAxes: Partial<DefaultAxes>;
/**
* An array containing all other boards that are updated after this board has been updated.
*/
dependentBoards: Board[];
/**
* Dimension of the board. Default value is 2.
*/
dimension: number;
/**
* Collects all elements that triggered a mouse down event.
*/
downObjects: unknown;
/**
* The distance from the mouse to the dragged object in x direction when the user clicked the mouse button.
*/
drag_dx: number;
/**
* The distance from the mouse to the dragged object in y direction when the user clicked the mouse button.
*/
drag_dy: number;
/**
* The last position where a drag event has been fired.
*/
drag_position: [number, number];
/**
* An associative array to store the objects of the board by name.
* The name of the object is the key and value is a reference to the object.
*/
elementsByName: { [name: string]: GeometryElement };
/**
* If GEONExT constructions are displayed, then this property should be set to true.
* At the moment there should be no difference. But this may change.
*/
geonextCompatibilityMode: boolean;
/**
* Grids keeps track of all grids attached to this board.
*/
grids: unknown[];
/**
* An associative array containing all groups belonging to the board.
* Key is the id of the group and value is a reference to the object.
*/
groups: { [id: string]: Group };
hasGrid?: boolean;
/**
* A flag which tells if the board registers mouse events.
*
* Default is false.
*/
hasMouseHandlers: boolean;
/**
* A flag which tells if the board the mouseUp event registered.
*
* Default is false.
*/
hasMouseUp: boolean;
/**
* A flag which stores if the board registered pointer events.
*
* Default is false.
*/
hasPointerHandlers: boolean;
/**
* A flag which tells if the board has a pointerUp event registered.
*/
hasPointerUp: boolean;
/**
* A flag which indicates whether the touchEnd event is registered.
*/
hasTouchEnd: boolean;
/**
* A flag which tells if the board registers touch events.
*/
hasTouchHandlers: boolean;
/**
* An associative array containing all highlighted elements belonging to the board.
*/
highlightedObjects: { [name: string]: unknown };
/**
* Information box close to points in which the coordinates of the point are displayed.
* Uses CSS class .JXGinfobox.
*/
infobox: Text;
/**
* During the update process this is set to false to prevent an endless loop.
*/
inUpdate: boolean;
/**
* A flag which tells us if the user is selecting.
*/
isSelecting: boolean;
/**
* If true updates are skipped.
*/
isSuspendedRedraw: boolean;
/**
* Keep aspect ratio if bounding box is set and the width/height ratio differs from the width/height ratio of the canvas.
*/
keepaspectratio: boolean;
/**
* The mode the board is currently in.
*/
mode: number;
/**
* Reference to the object that is dragged with the mouse on the board.
*/
mouse: unknown;
/**
* Full updates are needed after zoom and axis translates.
* This saves some time during an update.
*/
needsFullUpdate: boolean;
/**
* Number of objects ever created on this board.
* This includes every object, even invisible and deleted ones.
*/
numObjects: number;
/**
* An associative array containing all geometric objects belonging to the board.
* Key is the id of the object and value is a reference to the object.
*/
objects: { [id: string]: unknown };
/**
* An array containing all geometric objects on the board in the order of construction.
*/
objectsList: unknown[];
/**
*
*/
off: Function;
/**
* Coordinates of the boards origin.
* This a object with the two properties usrCoords and scrCoords.
* usrCoords always equals [1, 0, 0].
* scrCoords stores the boards origin in homogeneous screen coordinates.
*/
origin: {
usrCoords: [number, number, number];
scrCoords: [number, number, number];
};
/**
* Contains the last time (epoch, msec) since the last getCoordsTopLeftCorner call which was not thrown away.
*/
positionAccessLast: number;
/**
* If reducedUpdate is set to true then only the dragged element and few (e.g. 2) following elements are updated during mouse move.
* On mouse up the whole construction is updated.
* This enables us to be fast even on very slow devices.
*
* Default is false.
*/
reducedUpdate: boolean;
/**
*
*/
removeEvent: Function;
/**
* JessieCode
*/
jc: JessieCode;
/**
*
*/
options: JXGSettings;
/**
*
*/
renderer: {
dumpToCanvas(elementId: string): void;
/**
* Convert SVG construction to base64 encoded SVG data URL.
* Only available on SVGRenderer.
*/
dumpToDataURI(): string;
};
/**
* A bounding box for the selection.
*/
selectingBox: [[number, number], [number, number]];
/**
* A flag which tells us if the board is in the selecting mode.
*/
selectingMode: boolean;
/**
* Keeps track on touched elements, like JXG.Board#mouse does for mouse events.
*/
touches: unknown[];
/**
* Contains the last time (epoch, msec) since the last touchMove event which was not thrown away or since touchStart because Android's Webkit browser fires too much of them.
*/
touchMoveLast: number;
/**
*
*/
takeSizeFromFile: boolean;
/**
* The number of pixels which represent one unit in user-coordinates in x direction.
*/
unitX: number;
/**
* The number of pixels which represent one unit in user-coordinates in y direction.
*/
unitY: number;
/**
* The update quality of the board.
*/
updateQuality: number;
/**
* Zoom factor in the X direction.
*/
zoomX: number;
/**
* Zoom factor in the Y direction.
*/
zoomY: number;
/**
* Adds an animation.
* Animations are controlled by the boards, so the boards need to be aware of the animated elements.
* This function tells the board about new elements to animate.
* @param element The element which is to be animated.
* @returns Reference to the board.
*/
addAnimation(element: GeometryElement): Board;
/**
* Adds a dependent board to this board.
* @param board A reference to board which will be updated after an update of this board occurred.
* @returns Reference to the board.
*/
addChild(board: Board): Board;
addConditions(str: string): unknown;
addEventHandlers(): unknown;
addFullscreenEventHandlers(): unknown;
addGrid(): unknown;
/**
* Please use Board.on instead.
* @param hook A function to be called by the board after an update occurred.
* @param m When the hook is to be called. Possible values are 'mouseup', 'mousedown', and 'update'. Default 'update'.
* @param context Determines the execution context the hook is called. This parameter is optional, default is the board object the hook is attached to.
* @returns Id of the hook, required to remove the hook from the board.
*/
addHook(
hook: () => void,
m?: "mouseup" | "mousedown" | "update",
context?: unknown
): number;
addMouseEventHandlers(): unknown;
addPointerEventHandlers(): unknown;
addTouchEventHandlers(appleGestures: boolean): unknown;
/**
* General purpose animation function.
* This currently only supports moving points from one place to another.
* This is faster than managing the animation per point, especially if there is more than one animated point at the same time.
*/
animate(): this;
/**
* Apply update on all objects with the new zoom-factors.
* Clears all traces.
*/
applyZoom(): this;
/**
* Calculates adequate snap sizes.
*/
calculateSnapSizes(): this;
/**
* Delete the elements drawn as part of a trace of an element.
*/
clearTraces(): this;
/**
* Handler for click on down arrow in the navigation bar.
*/
clickDownArrow(): this;
clickLeftArrow(): this;
clickRightArrow(): this;
clickUpArrow(): this;
/**
* Creates a new geometric element of type elementType.
* @param elementType Type of the element to be constructed given as a string e.g. 'point' or 'circle'.
* @param parents
* @param attributes
*/
create<T extends GeometryElement | Composition | Array<GeometryElement>>(
elementType: string,
parents: unknown[],
attributes?: Record<string, unknown>
): T;
/**
*
* @param elementType 'angle'
* @param parents [centerPoint, radiusPoint, anglePoint] or [line1, line2, coords1 or direction1, coords2 or direction2]
* @param attributes
*/
create(elementType: "angle", parents: unknown[], attributes?: AngleAttributes): Angle;
/**
*
* @param elementType 'arc'
* @param parents
* @param attributes
*/
create(elementType: "arc", parents: unknown[], attributes?: ArcAttributes): Arc;
/**
*
* @param elementType 'arrow'
* @param parents
* @param attributes
*/
create(elementType: "arrow", parents: unknown[], attributes?: ArrowAttributes): Arrow;
/**
*
* @param elementType 'axis'
* @param parents
* @param attributes
*/
create(elementType: "axis", parents: unknown[], attributes?: AxisAttributes): Axis;
/**
*
* @param elementType 'bisector'
* @param parents
* @param attributes
*/
create(
elementType: "bisector",
parents: unknown[],
attributes?: BisectorAttributes
): Bisector;
/**
*
* @param elementType 'boxplot'
* @param parents
* @param attributes
*/
create(
elementType: "boxplot",
parents: unknown[],
attributes?: BoxplotAttributes
): Boxplot;
/**
*
* @param elementType 'button'
* @param parents
* @param attributes
*/
create(
elementType: "button",
parents: unknown[],
attributes?: ButtonAttributes
): Button;
/**
*
* @param elementType 'cardinalspline'
* @param parents
* @param attributes
*/
create(
elementType: "cardinalspline",
parents: unknown[],
attributes?: CardinalsplineAttributes
): Cardinalspline;
/**
*
* @param elementType 'chart'
* @param parents
* @param attributes
*/
create(elementType: "chart", parents: unknown[], attributes?: ChartAttributes): Chart;
/**
*
* @param elementType 'checkbox'
* @param parents
* @param attributes
*/
create(
elementType: "checkbox",
parents: unknown[],
attributes?: CheckboxAttributes
): Checkbox;
/**
*
* @param elementType 'circle'
* @param parents
* @param attributes
*/
create(
elementType: "circle",
parents: unknown[],
attributes?: CircleAttributes
): Circle;
/**
* @param elementType 'circumcircle'
* @param parents
* @param attributes
*/
create(
elementType: "circumcircle",
parents: unknown[],
attributes?: CircumcircleAttributes
): Circumcircle;
/**
* @param elementType 'circumcirclearc'
* @param parents
* @param attributes
*/
create(
elementType: "circumcirclearc",
parents: unknown[],
attributes?: CircumcircleArcAttributes
): CircumcircleArc;
/**
* @param elementType 'circumcirclesector'
* @param parents
* @param attributes
*/
create(
elementType: "circumcirclesector",
parents: unknown[],
attributes?: CircumcircleSectorAttributes
): CircumcircleSector;
/**
*
* @param elementType 'comb'
* @param parents
* @param attributes
*/
create(elementType: "comb", parents: unknown[], attributes?: CombAttributes): Comb;
/**
*
* @param elementType 'conic'
* @param parents
* @param attributes
*/
create(elementType: "conic", parents: unknown[], attributes?: ConicAttributes): Conic;
/**
*
* @param elementType 'curve'
* @param parents
* @param attributes
*/
create(elementType: "curve", parents: unknown[], attributes?: CurveAttributes): Curve;
/**
*
* @param elementType 'curvedifference'
* @param parents
* @param attributes
*/
create(
elementType: "curvedifference",
parents: unknown[],
attributes?: CurveAttributes
): Curve;
/**
*
* @param elementType 'curveintersection'
* @param parents
* @param attributes
*/
create(
elementType: "curveintersection",
parents: unknown[],
attributes?: CurveAttributes
): Curve;
/**
*
* @param elementType 'curveunion'
* @param parents
* @param attributes
*/
create(
elementType: "curveunion",
parents: unknown[],
attributes?: CurveAttributes
): Curve;
/**
*
* @param elementType 'ellipse'
* @param parents
* @param attributes
*/
create(
elementType: "ellipse",
parents: unknown[],
attributes?: EllipseAttributes
): Ellipse;
/**
*
* @param elementType 'functiongraph'
* @param parents
* @param attributes
*/
create(
elementType: "functiongraph",
parents: unknown[] | ((x: number) => number),
attributes?: FunctiongraphAttributes
): Functiongraph;
/**
*
* @param elementType 'glider'
* @param parents
* @param attributes
*/
create(
elementType: "glider",
parents: unknown[],
attributes?: GliderAttributes
): Glider;
/**
*
* @param elementType 'grid'
* @param parents
* @param attributes
*/
create(elementType: "grid", parents: unknown[], attributes?: GridAttributes): Grid;
/**
*
* @param elementType 'group'
* @param parents
* @param attributes
*/
create(elementType: "group", parents: unknown[], attributes?: GroupAttributes): Group;
/**
*
* @param elementType 'hatch'
* @param parents
* @param attributes
*/
create(elementType: "hatch", parents: unknown[], attributes?: HatchAttributes): Hatch;
/**
*
* @param elementType 'hyperbola'
* @param parents
* @param attributes
*/
create(
elementType: "hyperbola",
parents: unknown[],
attributes?: HyperbolaAttributes
): Hyperbola;
/**
*
* @param elementType 'image'
* @param parents
* @param attributes
*/
create(elementType: "image", parents: unknown[], attributes?: ImageAttributes): Image;
/**
*
* @param elementType 'inequality'
* @param parents
* @param attributes
*/
create(
elementType: "inequality",
parents: unknown[],
attributes?: InequalityAttributes
): Inequality;
/**
*
* @param elementType 'input'
* @param parents
* @param attributes
*/
create(elementType: "input", parents: unknown[], attributes?: InputAttributes): Input;
/**
*
* @param elementType 'integral'
* @param parents
* @param attributes
*/
create(
elementType: "integral",
parents: unknown[],
attributes?: IntegralAttributes
): Integral;
/**
*
* @param elementType 'intersection'
* @param parents
* @param attributes
*/
create(
elementType: "intersection",
parents: unknown[],
attributes?: IntersectionAttributes
): Intersection;
/**
*
* @param elementType 'line'
* @param parents
* @param attributes
*/
create(elementType: "line", parents: unknown[], attributes?: LineAttributes): Line;
/**
*
* @param elementType 'metapostspline'
* @param parents
* @param attributes
*/
create(
elementType: "metapostspline",
parents: unknown[],
attributes?: MetapostsplineAttributes
): Metapostspline;
/**
*
* @param elementType 'midpoint'
* @param parents
* @param attributes
*/
create(
elementType: "midpoint",
parents: unknown[],
attributes?: MidpointAttributes
): Midpoint;
/**
*
* @param elementType 'minorArc'
* @param parents
* @param attributes
*/
create(
elementType: "minorArc",
parents: unknown[],
attributes?: MinorArcAttributes
): MinorArc;
/**
*
* @param elementType 'mirrorelement'
* @param parents
* @param attributes
*/
create(
elementType: "mirrorelement",
parents: unknown[],
attributes?: MirrorelementAttributes
): Mirrorelement;
/**
*
* @param elementType 'normal'
* @param parents
* @param attributes
*/
create(
elementType: "normal",
parents: unknown[],
attributes?: NormalAttributes
): Normal;
/**
*
* @param elementType 'parabola'
* @param parents
* @param attributes
*/
create(
elementType: "parabola",
parents: unknown[],
attributes?: ParabolaAttributes
): Parabola;
/**
*
* @param elementType 'perpendicular'
* @param parents
* @param attributes
*/
create(
elementType: "perpendicular",
parents: unknown[],
attributes?: PerpendicularAttributes
): Perpendicular;
/**
*
* @param elementType 'plot'
* @param parents
* @param attributes
*/
create(elementType: "plot", parents: unknown[], attributes?: CurveAttributes): Curve;
/**
*
* @param elementType 'point'
* @param parents [x, y], [z, x, y], and [element, transformation].
* @param attributes
*/
create(elementType: "point", parents: unknown[], attributes?: PointAttributes): Point;
/**
*
* @param elementType 'polygon'
* @param parents
* @param attributes
*/
create(
elementType: "polygon",
parents: unknown[],
attributes?: PolygonAttributes
): Polygon;
/**
*
* @param elementType 'polygonalchain'
* @param parents
* @param attributes
*/
create(
elementType: "polygonalchain",
parents: unknown[],
attributes?: PolygonAttributes
): Polygon;
/**
*
* @param elementType 'regularpolygon'
* @param parents
* @param attributes
*/
create(
elementType: "regularpolygon",
parents: unknown[],
attributes?: PolygonAttributes
): Polygon;
/**
*
* @param elementType 'reflection'
* @param parents
* @param attributes
*/
create(
elementType: "reflection",
parents: unknown[],
attributes?: ReflectionAttributes
): Reflection;
/**
*
* @param elementType 'riemannsum'
* @param parents
* @param attributes
*/
create(
elementType: "riemannsum",
parents: unknown[],
attributes?: CurveAttributes
): Riemannsum;
/**
*
* @param elementType 'sector'
* @param parents
* @param attributes
*/
create(
elementType: "sector",
parents: unknown[],
attributes?: SectorAttributes
): Sector;
/**
*
* @param elementType 'semicircle'
* @param parents
* @param attributes
*/
create(
elementType: "semicircle",
parents: unknown[],
attributes?: SemicircleAttributes
): Semicircle;
/**
*
* @param elementType 'segment'
* @param parents
* @param attributes
*/
create(
elementType: "segment",
parents: unknown[],
attributes?: SegmentAttributes
): Segment;
/**
*
* @param elementType 'slider'
* @param parents
* @param attributes
*/
create(
elementType: "slider",
parents: unknown[],
attributes?: SliderAttributes
): Slider;
/**
*
* @param elementType 'slopetriangle'
* @param parents
* @param attributes
*/
create(
elementType: "slopetriangle",
parents: unknown[],
attributes?: SlopetriangleAttributes
): Slopetriangle;
/**
*
* @param elementType 'stepfunction'
* @param parents
* @param attributes
*/
create(
elementType: "stepfunction",
parents: unknown[],
attributes?: StepfunctionAttributes
): Stepfunction;
/**
*
* @param elementType 'tangent'
* @param parents
* @param attributes
*/
create(
elementType: "tangent",
parents: unknown[],
attributes?: TangentAttributes
): Tangent;
/**
*
* @param elementType 'tapemeasure'
* @param parents
* @param attributes
*/
create(
elementType: "tapemeasure",
parents?: unknown[],
attributes?: TapemeasureAttributes
): Tapemeasure;
/**
*
* @param elementType 'text'
* @param parents
* @param attributes
*/
create(elementType: "text", parents: unknown[], attributes?: TextAttributes): Text;
/**
*
* @param elementType 'ticks'
* @param parents
* @param attributes
*/
create(elementType: "ticks", parents: unknown[], attributes?: TicksAttributes): Ticks;
/**
*
* @param elementType 'tracecurve'
* @param parents
* @param attributes
*/
create(
elementType: "tracecurve",
parents: unknown[],
attributes?: TracecurveAttributes
): Tracecurve;
/**
*
* @param elementType 'transform'
* @param parents
* @param attributes
*/
create(
elementType: "transform",
parents: unknown[],
attributes?: TransformationAttributes
): Transformation;
/**
* Constructs a new Turtle object.
* @param elementType 'turtle'
* @param parents Start position and start direction of the turtle. Possible values are [x, y, angle] [[x, y], angle] [x, y] [[x, y]].
* @param attributes Attributes to change the visual properties of the turtle object All angles are in degrees.
*/
create(
elementType: "turtle",
parents?: unknown[],
attributes?: TurtleAttributes
): Turtle;
/**
*
* @param elementType
* @param parents
* @param attributes
*/
create(
elementType: "view3d",
parents?: unknown[],
attributes?: View3DAttributes
): View3D;
/**
* @param c1
* @param c2
* @param start_c1
* @param stepsize
* @param direction
* @param time
* @param pointlist
*/
createRoulette(
c1: Curve,
c2: Curve,
start_c1: number,
stepsize: number,
direction: number,
time: number,
pointlist: Point[]
): unknown;
/**
* Remove highlighting of all elements.
*/
dehighlightAll(): this;
/**
* Set infobox visible / invisible. It uses its property hiddenByParent to memorize its status.
* In this way, many DOM access can be avoided.
* @param value true for visible, false for invisible.
*/
displayInfobox(value: boolean): this;
/**
*
*/
emulateColorblindness(deficiency: "protanopia" | "deuteranopia" | "tritanopia"): this;
/**
* After construction of the object the visibility is set and the label is constructed if necessary.
* @param obj The object to add.
*/
finalizeAdding(obj: unknown): unknown;
fullscreenListener(evt: unknown): unknown;
fullUpdate(): this;
generateId(): string;
generateName(object: unknown): string;
gestureChangeListener(evt: unknown): boolean;
gestureStartListener(evt: unknown): boolean;
getAllObjectsUnderMouse(evt: unknown): unknown[];
getAllUnderMouse(evt: unknown): unknown[];
getBoundingBox(): [x1: number, y1: number, x2: number, y2: number];
getCoordsTopLeftCorner(): [number, number];
getMousePosition(e: unknown, i?: number): [number, number];
getScrCoordsOfMouse(x: number, y: number): [number, number];
getUsrCoordsOfMouse(evt: unknown): [number, number];
hasPoint(x: number, y: number): boolean;
highlightCustomInfobox(text: string, element?: GeometryElement): this;
highlightInfobox(x: number, y: number, element?: GeometryElement): this;
initInfobox(): this;
initMoveObject(
x: number,
y: number,
event: unknown,
type: "mouse" | "pen" | "touch"
): GeometryElement[];
initMoveOrigin(x: number, y: number): unknown;
migratePoint(src: Point, dest: Point, copyName: boolean): this;
mouseDownListener(event: unknown): boolean;
mouseMoveListener(event: unknown): boolean;
mouseUpListener(event: unknown): boolean;
mouseWheelListener(event: unknown): boolean;
moveObject(
x: number,
y: number,
o: unknown,
event: unknown,
type: "mouse" | "touch"
): unknown;
moveOrigin(x: number, y: number, diff?: boolean): this;
/**
* Register a new event handler.
* For a list of possible events see documentation of the elements and objects
* implementing the EventEmitter interface.
* @method on
* @param event {string}
* @param handler {()=>void}
* @param context [{}] The context the handler will be called in, default is the element itself.
* @returns Reference to the object.
*/
on(event: string, handler: (evt: PointerEvent) => void, context?: {}): {};
pointerDownListener(event: unknown, object: unknown): boolean;
pointerMoveListener(event: unknown): boolean;
pointerOutListener(event: unknown): boolean;
pointerUpListener(event: unknown): boolean;
prepareUpdate(): this;
removeAncestors(element: GeometryElement): this;
removeChild(board: Board): Board;
removeEventHandlers(): unknown;
removeFullscreenEventHandlers(): unknown;
removeGrids(): this;
removeHook(id: number | Function): this;
removeMouseEventHandlers(): unknown;
/**
* Removes object from board and renderer.
*
* Performance hints: It is recommended to use the object's id.
* If many elements are removed, it is best to call board.suspendUpdate() before looping through the elements to be removed and call board.unsuspendUpdate() after the loop.
* Further, it is advisable to loop in reverse order, i.e. remove the object in reverse order of their creation time.
*
* @param object The object to remove or array of objects to be removed. The element(s) is/are given by name, id or a reference.
* @param saveMethod If true, the algorithm runs through all elements and tests if the element to be deleted is a child element. If yes, it will be removed from the list of child elements. If false (default), the element is removed from the lists of child elements of all its ancestors. This should be much faster.
* @returns Reference to the board.
*/
removeObject(
object: (string | GeometryElement) | (string | GeometryElement)[],
saveMethod?: boolean
): this;
removePointerEventHandlers(): unknown;
removeTouchEventHandlers(): unknown;
/**
* @param width
* @param height
*/
resizeContainer(
width: number,
height: number,
dontSetCssWidthAndHeight?: boolean,
dontSetBoundingBox?: boolean
): this;
select(
id: string | unknown | Function,
onlyByIdOrName: boolean
): GeometryElement | Composition;
/**
*
*/
setBoundingBox(
bbox: [number, number, number, number],
keepaspectratio?: boolean,
setZoom?: string
): this;
setId(object: unknown, type: number): string;
/**
*
*/
setZoom(fX: number, fY: number): Board;
showDependencies(): this;
showXML(): this;
startResizeObserver(): unknown;
startSelectionMode(): unknown;
/**
* Cancels all running animations.
*/
stopAllAnimation(): Board;
stopResizeObserver(): unknown;
stopSelectionMode(): [Coords, Coords];
/**
* Stop updates of the board.
* return Reference to the board
*/
suspendUpdate(): Board;
toFullscreen(): this;
touchEndListener(event: unknown): boolean;
touchMoveListener(event: unknown): boolean;
touchStartListener(event: unknown): boolean;
twoFingerMove(
p1: [number, number],
p2: [number, number],
o: unknown,
event: unknown
): unknown;
twoFingerTouchObject(
np1c: Coords,
np2c: Coords,
o: unknown,
drag: unknown,
event: unknown
): unknown;
/**
* Enables updates of the board.
* return Reference to the board
*/
unsuspendUpdate(): this;
/**
* Runs through most elements and calls their update() method and update the conditions.
* @param drag Element that caused the update.
* return Reference to the board
*/
update(drag?: GeometryElement): this;
updateConditions(): this;
updateCoords(): this;
updateCSSTransforms(): this;
updateElements(drag: GeometryElement): this;
updateHooks(m: unknown): this;
updateInfobox(element: GeometryElement): this;
updateRenderer(): this;
updateRendererCanvas(): this;
/**
* Resets zoom factor to 100%.
*/
zoom100(): this;
/**
* Zooms the board so every visible point is shown. Keeps aspect ratio.
*/
zoomAllPoints(): this;
/**
* Reset the bounding box and the zoom level to 100% such that a given set of elements is within the board's viewport.
* @param elements
*/
zoomElements(elements: unknown[]): this;
/**
* Zooms into the board by the factors board.attr.zoom.factorX and board.attr.zoom.factorY and applies the zoom.
* The zoom operation is centered at x, y.
* @param x
* @param y
*/
zoomIn(x?: number, y?: number): this;
/**
* Zooms out of the board by the factors board.attr.zoom.factorX and board.attr.zoom.factorY and applies the zoom.
* The zoom operation is centered at x, y.
* @param x
* @param y
*/
zoomOut(x?: number, y?: number): this;
}
export interface ZoomOptions {
/**
* Horizontal zoom factor (multiplied to Board.zoomX).
*/
factorX?: number;
/**
* Vertical zoom factor (multiplied to Board.zoomY).
*/
factorY?: number;
/**
* Allow zooming by mouse wheel or by pinch-to-zoom gesture on touch devices.
*/
wheel?: boolean;
/**
* Mouse wheel zooming needs pressing of the Shift key.
*/
needShift?: boolean;
/**
* Minimal values of Board.zoomX and Board.zoomY. Limits zoomOut.
*/
min?: number;
/**
* Maximal values of Board.zoomX and Board.zoomY. Limits zoomIn.
*/
max?: number;
/**
* Allow pinch-to-zoom to zoom only horizontal axis.
*/
pinchHorizontal?: boolean;
/**
* Allow pinch-to-zoom to zoom only vertical axis.
*/
pinchVertical?: boolean;
/**
* Sensitivity (in degrees) for recognizing horizontal or vertical pinch-to-zoom gestures.
*/
pinchSensitivity?: number;
}
/**
* Attributes used in board initialization.
*/
export interface BoardAttributes {
/**
* Show default axis.
* If shown, the horizontal axis can be accessed via JXG.Board.defaultAxes.x, the
* vertical axis can be accessed via JXG.Board.defaultAxes.y. Both axes have a sub-element "defaultTicks".
* default false
*/
axis: boolean;
beautifulScientificTickLabels: boolean;
/**
*
*/
defaultAxes: Partial<DefaultAxes>;
/**
* Bounding box of the visible area in user coordinates.
* It is an array consisting of four values: [x1, y1, x2, y2].
*
* The canvas will be spanned from the upper left corner (x1, y1) to the lower right corner (x2, y2).
*
* default is [-5, 5, 5, -5].
*/
boundingbox: [x1: number, y1: number, x2: number, y2: number];
/**
* Bounding box of the visible area in user coordinates.
* It is an array consisting of four values: [x1, y1, x2, y2].
*
* The canvas will be spanned from the upper left corner (x1, y1) to the lower right corner (x2, y2).
*
* default is [-5, 5, 5, -5].
*/
boundingBox: [x1: number, y1: number, x2: number, y2: number];
description: string;
maxBoundingBox: [
x1: number | null,
y1: number | null,
x2: number | null,
y2: number | null
];
/**
* Supply the document object. Defaults to window.document
*
* default false (meaning window.document)
*/
document: boolean | Document;
drag: {
enabled?: boolean;
};
/**
* If true the first element of the set JXG.board.objects having hasPoint==true is taken as drag element.
*
* default false
*/
takeFirst: boolean;
/**
* If true, when read from a file or string - the size of the div can be changed by the construction text.
*
* default false
*/
takeSizeFromFile: boolean;
/**
* Time (in msec) between two animation steps.
*
* default 35
*/
animationDelay: number;
/**
* Allow user interaction by registering mouse and touch events.
*
* default true
*/
registerEvents: boolean;
maxFrameRate: number;
/**
* Change redraw strategy in SVG rendering engine.
*
* If set to 'svg', before every redrawing of the JSXGraph construction
* the SVG sub-tree of the DOM tree is taken out of the DOM.
*
* If set to 'all', before every redrawing of the JSXGraph construction the
* complete DOM tree is taken out of the DOM.
* If set to 'none' the redrawing is done in-place.
*
* Using 'svg' or 'all' speeds up the update process considerably. The risk
* is that if there is an exception, only a white div or window is left.
*/
minimizeReflow: "svg" | "all" | "none";
/**
* A number that will be added to the absolute position of the board used in mouse coordinate
* calculations in {@link JXG.Board#getCoordsTopLeftCorner}.
*
* default 0
*/
offsetX: number;
/**
* A number that will be added to the absolute position of the board used in mouse coordinate
* calculations in {@link JXG.Board#getCoordsTopLeftCorner}.
*
* default 0
*/
offsetY: number;
/**
* Control the possibilities for panning interaction (i.e. moving the origin).
*/
pan: {
needShift?: boolean;
needTwoFingers?: boolean;
enabled?: boolean;
};
/**
*
*/
grid: boolean;
/**
* If set true and
* hasPoint() is true for both an element and it's label,
* the element (and not the label) is taken as drag element.
*
* If set false and hasPoint() is true for both an element and it's label,
* the label is taken (if it is on a higher layer than the element)
*
* default true
*/
ignoreLabels: boolean;
/**
* If set to true the bounding box might be changed such that
* the ratio of width and height of the hosting HTML div is equal
* to the ratio of wifth and height of the bounding box.
*
* This is necessary if circles should look like circles and not
* like ellipses. It is recommended to set keepAspectRatio = true
* for geometric applets. For function plotting keepAspectRatio = false
* might be the better choice.
*
* default false
*/
keepAspectRatio: boolean;
/**
* Alias for keepAspectRatio.
*/
keepaspectratio: boolean;
/**
* Maximum number of digits in automatic label generation.
* For example, if set to 1 automatic point labels end at "Z".
* If set to 2, point labels end at "ZZ".
*
* default 1
*/
maxNameLength: number;
/**
* Default rendering engine. Possible values are 'svg', 'canvas', 'vml', 'no', or 'auto'.
* If the rendering engine is not available JSXGraph tries to detect a different engine.
*
* In case of 'canvas' it is advisable to call 'board.update()' after all elements have been
* constructed. This ensures that all elements are drawn with their intended visual appearance.
*
* default 'auto'
*/
renderer: "svg" | "canvas" | "vml" | "no" | "auto";
/**
* Control if JSXGraph reacts to resizing of the JSXGraph container element
* by the user / browser.
* The attribute "throttle" determines the minimal time in msec between to
* resize calls.
*/
resize: {
enabled?: boolean;
throttle: number;
};
selection: {
enabled?: boolean;
fillColor?: string;
name?: string;
needShift?: boolean;
needCtrl?: boolean;
vertices?: PointAttributes;
visible?: boolean;
withLines?: boolean;
};
/**
* Show a button which allows to clear all traces of a board.
*
* default false
*/
showClearTraces: boolean;
/**
* Show copyright string in canvas.
*
* default true
*/
showCopyright: boolean;
/**
* Show a button in the navigation bar to start fullscreen mode.
*
* default false
*/
showFullscreen: boolean;
fullscreen: {
symbol: string;
};
/**
* Determines whether the information box is displayed when hovering the mouse over geometry elements.
*/
showInfobox: boolean;
/**
* Show a button in the navigation bar to enable screenshots.
*
* default false
*/
showScreenshot: boolean;
/**
* Attributes used to control the screenshot function.
*/
screenshot: {
/**
* scaling factor (default 1)
*/
scale?: number;
/**
* format of the sceenshot image.
*/
type?: "png";
/**
* Unicode symbol which is shown in the navigation bar. Default: '\u2318'
*/
symbol?: string;
/**
* CSS rules to format the div element containing the screen shot image
*/
css?: string;
/**
* CSS rules to format the close button of the div element containing the screen shot image
*/
cssButton?: string;
};
/**
* Display of navigation arrows and zoom buttons
*
* default true
*/
showNavigation: boolean;
/**
* Show a button to force reload of a construction.
* Works only with the JessieCode tag
*
* default false
*/
showReload: boolean;
/**
* Display of zoom buttons. To show zoom buttons, additionally
* showNavigation has to be set to true.
*
* default true
*/
showZoom: boolean;
/**
* Title string for the board.
* Primarily used in an invisible text element which is adressed by
* the attribute 'aria-labelledby' from the JSXGraph container.
* JSXGraph creates a new div-element with id "{containerid}_ARIAlabel"
* containing this string.
*/
title: string;
/**
* Control the possibilities for zoom interaction.
*/
zoom: boolean | ZoomOptions;
// /**
// * Additional zoom factor multiplied to zoomX and zoomY.
// * default 1.0
// */
// zoomFactor: number;
/**
* Zoom factor in horizontal direction.
* default 1.0
*/
zoomX: number;
/**
* Zoom factor in vertical direction.
* default 1.0
*/
zoomY: number;
}
/**
*
*/
export interface Graph {
/**
* Stores the renderer that is used to draw the boards.
*/
rendererType: string;
/**
* Initialize a new board.
* @param elementId HTML identifier (id) of the HTML element in which the board is painted.
* @param attributes An object that sets some of the board properties.
*/
initBoard(elementId: string | object, attributes?: Partial<BoardAttributes>): Board;
/**
* Delete a board and all its contents.
*/
freeBoard(board: Board | string): void;
}
export interface LayerOptions {
numlayers?: number;
text?: number;
point?: number;
glider?: number;
arc?: number;
line?: number;
circle?: number;
curve?: number;
turtle?: number;
polygon?: number;
sector?: number;
angle?: number;
integral?: number;
axis?: number;
ticks?: number;
grid?: number;
image?: number;
trace?: number;
unused0?: number;
unused1?: number;
unused2?: number;
unused3?: number;
unused4?: number;
unused5?: number;
unused6?: number;
unused7?: number;
unused8?: number;
unused9?: number;
}
export interface NavbarOptions {
/**
* Default is '#333333'.
*/
strokeColor?: string;
/**
* Default is 'transparent'.
*/
fillColor?: string;
/**
* Default is '#aaaaaa'.
*/
highlightFillColor?: string;
/**
* Default is '2px'.
*/
padding?: string;
/**
* Default is 'absolute'.
*/
position?: string;
/**
* Default is '14px'.
*/
fontSize?: string;
/**
* Default is 'pointer'.
*/
cursor?: string;
/**
* Default is '100'.
*/
zIndex?: string;
/**
* Default is '5px'.
*/
right?: string;
/**
* Default is '5px'.
*/
bottom?: string;
}
export interface PrecisionOptions {
enabled?: boolean;
epsilon?: number;
hasPoint?: number;
mouse?: number;
pen?: number;
touch?: number;
touchMax?: number;
}
export interface TextOptions {
anchor?: Point | Text | Image | null;
anchorX?: AnchorX;
anchorY?: AnchorY;
attractors?: GeometryElement[];
cssClass?: string;
cssDefaultStyle?: string;
cssStyle?: string;
digits?: number;
display?: "html" | "internal";
dragArea?: "all" | "small";
fontSize?: number;
fontUnit?: "px" | "vw" | "vh" | "vmax" | "vmin" | "rem";
highlight?: boolean;
highlightCssClass?: string;
highlightCssDefaultStyle?: string;
highlightCssStyle?: string;
highlightStrokeColor?: string;
highlightStrokeOpacity?: number;
isLabel?: boolean;
parse?: boolean;
rotate?: number;
snapSizeX?: number;
snapSizeY?: number;
strokeColor?: string;
useASCIIMathML?: boolean;
useCaja?: boolean;
useMathJax?: boolean;
useKatex?: boolean;
katexMacros: Object;
visible?: boolean;
withLabel?: boolean;
}
export interface JXGSettings {
grid: GridOptions;
/**
* Default ordering of the layers.
*/
layer: LayerOptions;
/**
* Options that are used by the navigation bar.
*/
navbar: NavbarOptions;
point: PointAttributes;
/**
* Precision options.
*/
precision: PrecisionOptions;
/**
* Abbreviations of properties.
*/
shortcuts: {};
text: TextOptions;
}
export interface JXGOptions {
// TODO: These should all be XyzOptions, even if XyzOptions extends XyzAttributes (or converse).
angle: AngleOptions;
arc: ArcAttributes;
arrow: ArrowAttributes;
axis: AxisAttributes;
bisector: BisectorAttributes;
bisectorlines: {
line1?: BisectorAttributes;
line2?: BisectorAttributes;
};
board: Partial<BoardAttributes>;
button: ButtonAttributes;
cardinalspline: CardinalsplineAttributes;
chart: ChartAttributes;
checkbox: CheckboxAttributes;
circle: CircleOptions;
circumcircle: CircumcircleOptions;
circumcirclearc: CircumcircleArcOptions;
circumcirclesector: CircumcircleSectorOptions;
comb: CombOptions;
conic: ConicOptions;
curve: CurveOptions;
elements: GeometryElementAttributes;
glider: GliderOptions;
grid: GridOptions;
group: GroupOptions;
jc: {
enabled?: boolean;
compile?: boolean;
};
hatch: HatchAttributes;
htmlslider: SliderOptions;
image: ImageOptions;
incircle: IncircleOptions;
inequality: InequalityOptions;
infobox: InfoboxOptions;
integral: IntegralOptions;
input: InputOptions;
intersection: IntersectionOptions;
label: LabelOptions;
/**
* Default ordering of the layers.
*/
layer: LayerOptions;
legend: LegendOptions;
line: LineOptions;
locus: LocusOptions;
metapostspline: CardinalsplineOptions;
mirrorelement: MirrorelementOptions;
/**
* Options that are used by the navigation bar.
*/
navbar: NavbarOptions;
normal: NormalOptions;
orthogonalprojection: OrthogonalprojectionOptions;
parallel: ParallelOptions;
perpendicular: PerpendicularOptions;
perpendicularsegment: PerpendicularSegmentOptions;
/**
*
*/
point: PointOptions;
polygon: PolygonOptions;
polygonalchain: PolygonalChainOptions;
/**
* Precision options.
*/
precision: PrecisionOptions;
prescribedangle: PrescribedAngleOptions;
reflection: ReflectionOptions;
regularpolygon: RegularPolygonOptions;
riemannsum: RiemannsumOptions;
sector: SectorOptions;
segment: SegmentOptions;
semicircle: SemicircleOptions;
slider: SliderOptions;
/**
* Abbreviations of properties.
*/
shortcuts: {};
slopetriangle: SlopetriangleOptions;
stepfunction: StepfunctionOptions;
takeSizeFromFile?: boolean;
tapemeasure: TapemeasureOptions;
ticks: TicksOptions;
text: TextOptions;
tracecurve: TracecurveOptions;
turtle: TurtleOptions;
}
/**
*
*/
const JSXGraph: Graph;
let Options: JXGOptions;
/**
*
*/
export interface Dump {
toJavaScript(board: Board): string;
toJessie(board: Board): string;
}
/**
* Dump Namespace.
*/
const Dump: Dump;
/**
*
*/
export interface Math {
/**
* Functional version of binary operator &&
* @param a.
* @param b.
* @returns Boolean value of a && b.
*/
and(a: boolean, b: boolean): boolean;
/**
* eps defines the closeness to zero.
* If the absolute value of a given number is smaller than eps, it is considered to be equal to zero.
*/
eps: number;
/**
* Hyperbolic arc-cosine of a number.
*
* @param x
*/
acosh(x: number): number;
/**
* Hyperbolic arcsine of a number.
*
* @param x
*/
asinh(x: number): number;
/**
* Computes the binomial coefficient n over k.
* @param n
* @param k
*/
binomial(n: number, k: number): number;
/**
* Computes the hyperbolic cosine of x.
* @param x
*/
cosh(x: number): number;
/**
* Functional version of binary operator ===
* @param a.
* @param b.
* @returns Boolean value of a === b.
*/
eq(a: number, b: number): boolean;
/**
* Error function
*
* @param x
*/
erf(x: number): number;
/**
* Complementary error function
*
* @param x
*/
erfc(x: number): number;
/**
* Inverse error function
*
* @param x
*/
erfi(x: number): number;
/**
* Compute the factorial of a positive integer. If a non-integer value is given, the fraction will be ignored.
* @param n
* @returns n! = n * (n-1) * ... * 2 * 1
*/
factorial(n: number): number;
/**
* Greatest common divisor (gcd) of two numbers.
*
* @param a.
* @param b.
* @returns gcd(a, b) if a and b are numbers, NaN else.
*/
gcd(a: number, b: number): number;
/**
* Functional version of binary operator >=
* @param a.
* @param b.
* @returns Boolean value of a >= b.
*/
geq(a: number, b: number): boolean;
/**
* Functional version of binary operator >
* @param a.
* @param b.
* @returns Boolean value of a > b.
*/
gt(a: number, b: number): boolean;
/**
* Compute the inverse of an nxn matrix with Gauss elimination.
*/
inverse(Ain: number[][]): number[][];
/**
* Least common multiple (lcm) of two numbers.
*
* @param a.
* @param b.
* @returns lcm(a, b) if a and b are numbers, NaN else.
*/
lcm(a: number, b: number): number;
/**
* Functional version of binary operator <=
* @param a.
* @param b.
* @returns Boolean value of a <= b.
*/
leq(a: number, b: number): boolean;
/**
* Logarithm to base 10.
* @param a.
* @returns logarithm of a to base 10.
*/
log10(a: number): number;
/**
* Logarithm to base 2.
* @param a.
* @returns logarithm of a to base 2.
*/
log2(a: number): number;
/**
* Functional version of binary operator <
* @param a.
* @param b.
* @returns Boolean value of a < b.
*/
lt(a: number, b: number): boolean;
/**
* Computes the product of the two matrices mat1*mat2.
* @param mat1 Two dimensional array of numbers.
* @param mat2 Two dimensional array of numbers.
* @returns Two dimensional Array of numbers containing result.
*/
matMatMult(mat1: number[][], mat2: number[][]): number[][];
/**
* Multiplies a vector vec to a matrix mat: mat * vec. The matrix is interpreted by this function as an array of rows.
* Please note: This function does not check if the dimensions match.
* @param mat Two dimensional array of numbers. The inner arrays describe the columns, the outer ones the matrix' rows.
* @param vec Array of numbers.
* @returns Array of numbers containing the result.
*/
matVecMult(mat: number[][], vec: number[]): number[];
/**
* The Javascript implementation of the % operator returns the symmetric modulo.
* mod and "%" are both identical if a >= 0 and m >= 0 but the results differ if a or m < 0.
* @param a.
* @param m.
* @returns mathematical modulo a mod m.
*/
mod(a: number, m: number): number;
/**
* Normal distribution function
*
* @param x
*/
ndtr(x: number): number;
/**
* Inverse of normal distribution function
*
* @param x
*/
ndtri(x: number): number;
/**
* Functional version of binary operator !==
* @param a.
* @param b.
* @returns Boolean value of a !== b.
*/
neq(a: number, b: number): boolean;
/**
* Functional version of unary operator !
* @param a.
* @param b.
* @returns Boolean value of !a.
*/
not(a: number): boolean;
/**
* Functional version of binary operator ||
* @param a.
* @param b.
* @returns Boolean value of a || b.
*/
or(a: boolean, b: boolean): boolean;
/**
* Computes base to the power of exponent.
* @param base
* @param exponent
*/
pow(base: number, exponent: number): number;
/**
* Determine the relative difference between two numbers.
* @param a.
* @param b.
* @returns Relative difference between a and b: |a-b| / max(|a|, |b|).
*/
relDif(a: number, b: number): number;
/**
* Sine hyperbolicus of x.
* @param x The number the sine hyperbolicus will be calculated of.
* @returns Sine hyperbolicus of the given value.
*/
sinh(x: number): number;
/**
* A square & multiply algorithm to compute base to the power of exponent.
*
* @param base.
* @param exponent.
* @returns base to the power of exponent.
*/
squampow(base: number, exponent: number): number;
/**
* Transposes a matrix given as a two dimensional array.
* @param M The matrix to be transposed.
* @returns The transpose of M.
*/
transpose(M: number[][]): number[][];
/**
* Functional version of a binary operator xor
* @param a.
* @param b.
* @returns Boolean value of a xor b.
*/
xor(a: boolean, b: boolean): boolean;
/* -------------------------------------------------- */
/**
* Inner product of two vectors a and b. n is the length of the vectors.
* @param a
* @param b
* @param n optional
* @returns Inner product of a and b.
*/
innerProduct(a: number[], b: number[], n: number): number;
/**
* Cross product of two vectors a and b, both of length three.
* @param a
* @param b
* @returns Cross product of a and b.
*/
crossProduct(a: number[], b: number[]): number;
/**
* Euclidean norm of vector a of length n.
* @param a
* @param n
* @returns Euclidean norm of a.
*/
norm(a: number[], n: number): number;
/**
* Computes the cotangent of x.
* @param x
*/
cot(x: number): number;
/**
* Computes the inverse of cotangent of x.
* @param x
*/
acot(x: number): number;
/**
* Compute n-th real root of a real number. n must be strictly positive integer.
* If n is odd, the real n-th root exists and is negative.
* For n even, for negative valuees of x NaN is returned.
* @param a
* @param n
*/
nthroot(a: number, n: number): number;
/**
* Computes cube root of real number.
* @param a
*/
cbrt(a: number): number;
/**
* Compute base to the power of the rational exponent m / n.
* This function first reduces the fraction m/n and then computes JXG.Math.pow(base, m/n).
* @param a
*/
ratpow(base: number, m: number, n: number): number;
/* -------------------------------------------------- */
Clip: Clip;
Geometry: Geometry;
/**
* Numerical algorithms, constants, and variables.
*/
Numerics: Numerics;
/**
* Functions for mathematical statistics.
*/
Statistics: Statistics;
}
/**
* Math Namespace
*/
const Math: Math;
/**
* This namespace contains algorithms for Boolean operations on paths, i.e. intersection, union and difference of paths.
* Base is the Greiner-Hormann algorithm.
*/
export interface Clip {
/**
* Difference of two closed paths, i.e. path1 minus path2.
* The paths could be JSXGraph elements circle, curve, or polygon.
* Computed by the Greiner-Hormann algorithm.
* @param subject First closed path.
* @param clip Second closed path.
* @param board JSXGraph board object. It is needed to convert between user coordinates and screen coordinates.
* @returns Array consisting of two arrays containing the x-coordinates and the y-coordinates of the resulting path.
*/
difference(
subject: Circle | Curve | Polygon,
clip: Circle | Curve | Polygon,
board: Board
): [number[], number[]];
/**
* Determine the intersection, union or difference of two closed paths.
*
* This is an implementation of the Greiner-Hormann algorithm, see Günther Greiner and Kai Hormann (1998).
* "Efficient clipping of arbitrary polygons".
* ACM Transactions on Graphics. 17 (2): 71–83. and Erich, L. Foster, and Kai Hormann, Kai, and Romeo Traaian Popa (2019), "Clipping simple polygons with degenerate intersections", Computers & Graphics:X, 2.
*
* It is assumed that the pathes are closed, whereby it does not matter if the last point indeed equals the first point.
* In contrast to the original Greiner-Hormann algorithm, this algorithm can cope with many degenerate cases.
* A degenerate case is a vertext of one path which is contained in the other path.
*
* Problematic are:
* degenerate cases where one path additionally has self-intersections
* differences with one path having self-intersections.
* @param subject First closed path, usually called 'subject'.
* @param clip Second closed path, usually called 'clip'.
* @param clipType Determines the type of boolean operation on the two paths. Possible values are 'intersection', 'union', or 'difference'.
* @param board JSXGraph board object. It is needed to convert between user coordinates and screen coordinates.
* @returns Array consisting of two arrays containing the x-coordinates and the y-coordinates of the resulting path.
*/
greinerHormann(
subject: Circle | Curve | Polygon,
clip: Circle | Curve | Polygon,
clipType: "difference" | "intersection" | "union",
board: Board
): [number[], number[]];
/**
* Intersection of two closed paths.
* The paths could be JSXGraph elements circle, curve, or polygon.
* Computed by the Greiner-Hormann algorithm.
* @param subject First closed path.
* @param clip Second closed path.
* @param board JSXGraph board object. It is needed to convert between user coordinates and screen coordinates.
* @returns Array consisting of two arrays containing the x-coordinates and the y-coordinates of the resulting path.
*/
intersection(
subject: Circle | Curve | Polygon,
clip: Circle | Curve | Polygon,
board: Board
): [number[], number[]];
/**
* Union of two closed paths.
* The paths could be JSXGraph elements circle, curve, or polygon.
* Computed by the Greiner-Hormann algorithm.
* @param subject First closed path.
* @param clip Second closed path.
* @param board JSXGraph board object. It is needed to convert between user coordinates and screen coordinates.
* @returns Array consisting of two arrays containing the x-coordinates and the y-coordinates of the resulting path.
*/
union(
subject: Circle | Curve | Polygon,
clip: Circle | Curve | Polygon,
board: Board
): [number[], number[]];
/**
* Winding number of a point in respect to a polygon path.
* The point is regarded outside if the winding number is zero, inside otherwise.
* The algorithm tries to find degenerate cases, i.e. if the point is on the path.
* This is regarded as "outside". If the point is a vertex of the path, it is regarded as "inside".
* Implementation of algorithm 7 from "The point in polygon problem for arbitrary polygons" by Kai Hormann and Alexander Agathos, Computational Geometry, Volume 20, Issue 3, November 2001, Pages 131-144.
* @param usrCoords Homogenous coordinates of the point.
* @param path Array of JXG.Coords determining a path, i.e. the vertices of the polygon.
* @returns Winding number of the point. The point is regarded outside if the winding number is zero, inside otherwise.
*/
windingNumber(usrCoords: number[], path: Point[]): number;
}
export interface Geometry {
/**
* Calculates the angle defined by the points A, B, C.
* @deprecated
*/
angle(A: Point | number[], B: Point | number[], C: Point | number[]): number;
/**
* Calculates the distance of a point to a line.
* The point and line are given by homogeneous coordinates.
* For lines this can be line.stdform.
* @param point Homogeneous coordinates of a point.
* @param line Homogeneous coordinates of a point.
*/
distPointLine(
point: [C: number, A: number, B: number],
line: [C: number, A: number, B: number]
): number;
/**
* Calculates the internal angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.
*/
rad(A: Point | number[], B: Point | number[], C: Point | number[]): number;
/**
* Calculates the angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.
* @param A
* @param B
* @param C
* @returns The angle in degrees.
*/
trueAngle(
A: Point | [x: number, y: number],
B: Point | [x: number, y: number],
C: Point | [x: number, y: number]
): number;
}
/**
* The JXG.Math.Numerics namespace holds numerical algorithms, constants, and variables.
*/
export interface Numerics {
maxIterationsMinimize: number;
maxIterationsRoot: number;
/**
* Integral of function f over interval.
* @param interval The integration interval, e.g. [0, 3].
* @param f A function which takes one argument and returns a number.
* @returns The value of the integral of f over integral.
*/
I(interval: [number, number], f: (t: number) => number): number;
backwardSolve(R: number[][], b: number[], canModify?: boolean): number[];
bezier(points: Point[]): [x: (t: number) => number[], y: (t: number) => number[]];
bspline(
points: Point[],
order: number
): [
x: (t: number) => number,
y: (t: number) => number,
zeroValue: number,
N: () => number
];
/**
* Numerical (symmetric) approximation of derivative.
*/
D(f: (x: number) => number, obj?: any): (x: number) => number;
/**
* Solves a system of linear equations given by A and b using the Gauss-Jordan-elimination.
* The algorithm runs in-place. I.e. the entries of A and b are changed.
* @param A Square matrix represented by an array of rows, containing the coefficients of the linear equation system.
* @param b A vector containing the linear equation system's right hand side.
* @returns A vector that solves the linear equation system.
*/
Gauss(A: number[][], b: number[]): number[];
/**
* Computes the polynomial through a given set of coordinates in Lagrange form.
* Returns the Lagrange polynomials, see Jean-Paul Berrut, Lloyd N. Trefethen: Barycentric Lagrange Interpolation,
* SIAM Review, Vol 46, No 3, (2004) 501-517.
* @returns A function of one parameter which returns the value of the polynomial, whose graph runs through the given points.
*/
lagrangePolynomial(p: Point[]): (t: number) => number;
/**
* Helper function to create a curve which displays Riemann sums.
* @param f Function or array of two functions. If f is a function the integral of this function is approximated by the Riemann sum. If f is an array consisting of two functions the area between the two functions is filled by the Riemann sum bars.
* @param n number of rectangles.
* @param type Type of approximation. Possible values are: 'left', 'right', 'middle', 'lower', 'upper', 'random', 'simpson', or 'trapezoidal'.
* @param start Left border of the approximation interval.
* @param end Right border of the approximation interval.
* @returns An array with three elements. The first two are number arrays containing the x and y coordinates for the rectangles showing the Riemann sum. This array may be used as parent array of a JXG.Curve. The third element is a number, the riemann sum, i.e. the sum of the volumes of all rectangles.
*/
riemann(
f: (x: number) => number,
n: number,
type: RiemannSumType,
start: number,
end: number
): [xCoords: number[], yCoords: number[], sum: number];
/**
* Approximate the integral by Riemann sums.
* @param f Function or array of two functions. If f is a function the integral of this function is approximated by the Riemann sum. If f is an array consisting of two functions the area between the two functions is filled by the Riemann sum bars.
* @param n number of rectangles.
* @param type Type of approximation. Possible values are: 'left', 'right', 'middle', 'lower', 'upper', 'random', 'simpson', or 'trapezoidal'.
* @param start Left border of the approximation interval.
* @param end Right border of the approximation interval.
* @returns The sum of the areas of the rectangles.
* @deprecated
*/
riemannsum(
f: (x: number) => number,
n: number,
type: RiemannSumType,
start: number,
end: number
): number;
/**
* Solve initial value problems numerically using Runge-Kutta-methods.
* See https://en.wikipedia.org/wiki/Runge-Kutta_methods for more information on the algorithm.
* @param butcher
* @param x0
* @param I
* @param N
* @param f
* return An array of vectors describing the solution of the o.d.e. on the given interval I.
*/
rungeKutta(
butcher: unknown,
x0: number[],
I: number[],
N: number,
f: unknown
): number[][];
}
/**
* Functions for mathematical statistics.
*/
export interface Statistics {
/**
* Extracts the maximum value from the array.
* @param arr
* @returns The highest number from the array. It returns NaN if not every element could be interpreted as a number and -Infinity if an empty array is given or no element could be interpreted as a number.
*/
max(arr: number[]): number;
/**
* Extracts the minimum value from the array.
* @param arr
* @returns The lowest number from the array. It returns NaN if not every element could be interpreted as a number and Infinity if an empty array is given or no element could be interpreted as a number.
*/
min(arr: number[]): number;
/**
* The P-th percentile ( 0 < P ≤ 100 ) of a list of N ordered values (sorted from least to greatest) is the smallest value in the list such that no more than P percent of the data is strictly less than the value and at least P percent of the data is less than or equal to that value.
* See https://en.wikipedia.org/wiki/Percentile. Here, the linear interpolation between closest ranks method is used.
* @param arr The set of values, need not be ordered.
* @param percentile One or several percentiles.
* @returns Depending if a number or an array is the input for percentile, a number or an array containing the percentils is returned.
*/
percentile(arr: number[], percentile: number | number[]): number | number[];
}
}
/**
* JSXGraph in the module "jsxgraph".
*/
declare module "jsxgraph" {
export = JXG;
}
|