/usr/share/octave/packages/geometry-1.7.0/geom2d/doc-cache is in octave-geometry 1.7.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | # Created by Octave 3.8.0, Tue Feb 25 00:02:53 2014 UTC <root@aatxe>
# name: cache
# type: cell
# rows: 3
# columns: 116
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
angle2Points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 412
-- Function File: ALPHA = angle2Points (P1, P2)
Compute horizontal angle between 2 points
P1 and P2 are either [1x2] arrays, or [Nx2] arrays, in this case
ALPHA is a [Nx1] array. The angle computed is the horizontal angle
of the line (P1,P2).
Result is always given in radians, between 0 and 2*pi.
See also: points2d, angles2d, angle3points, normalizeAngle,
vectorAngle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Compute horizontal angle between 2 points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
angle3Points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 411
-- Function File: ALPHA = angle3Points (P1, P2, P3)
Computes the angle between the points P1, P2 and P3.
P1, P2 and P3 are either [1x2] arrays, or [Nx2] arrays, in this
case ALPHA is a [Nx1] array. The angle computed is the directed
angle between line (P2P1) and line (P2P3).
Result is always given in radians, between 0 and 2*pi.
See also: points2d, angles2d, angle2points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Computes the angle between the points P1, P2 and P3.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
angleAbsDiff
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 323
-- Function File: DIF = angleAbsDiff (ANGLE1, ANGLE2)
Computes the absolute angular difference between two angles in
radians. The result is comprised between 0 and pi.
A = angleAbsDiff(pi/2, pi/3)
A =
0.5236 # equal to pi/6
See also: angles2d, angleDiff.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
Computes the absolute angular difference between two angles in radians.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
angleDiff
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 383
-- Function File: DIF = angleDiff (ANGLE1, ANGLE2)
Difference between two angles
Computes the signed angular difference between two angles in
radians. The result is comprised between -PI and +PI.
Example A = angleDiff(-pi/4, pi/4) A = 1.5708 # equal to pi/2 A =
angleDiff(pi/4, -pi/4) A = -1.5708 # equal to -pi/2
See also: angles2d, angleAbsDiff.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Difference between two angles
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
angleSort
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 648
-- Function File: varargout = angleSort (PTS, varargin)
Sort points in the plane according to their angle to origin
PTS2 = angleSort(PTS); Computes angle of points with origin, and
sort points with increasing angles in Counter-Clockwise direction.
PTS2 = angleSort(PTS, PTS0); Computes angles between each point of
PTS and PT0, which can be different from origin.
PTS2 = angleSort(..., THETA0); Specifies the starting angle for
sorting.
[PTS2, I] = angleSort(...); Also returns in I the indices of PTS,
such that PTS2 = PTS(I, :);
See also: points2d, angles2d, angle2points, normalizeAngle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Sort points in the plane according to their angle to origin
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
angles2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 622
-- Function File: angles2d ()
Description of functions for manipulating angles
Angles are normalized in an interval of width 2*PI. Most geom2d
functions return results in the [0 2*pi] interval, but it can be
convenient to consider the [-pi pi] interval as well. See the
normalizeAngle function to switch between conventions.
Angles are usually oriented. The default orientation is the CCW
(Counter-Clockwise) orientation.
See also: angle2Points, angle3Points, angleAbsDiff, normalizeAngle,
vectorAngle, angleDiff, angleSort, lineAngle, edgeAngle, deg2rad,
rad2deg.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Description of functions for manipulating angles
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
beltproblem
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1320
-- Function File: [TANGENT,INNER] = beltproblem (C, R)
Finds the four lines tangent to two circles with given centers and
radii.
The function solves the belt problem in 2D for circles with center
C and radii R.
*INPUT*
C
2-by-2 matrix containig coordinates of the centers of the
circles; one row per circle.
R
2-by-1 vector with the radii of the circles.
*OUPUT*
TANGENT
4-by-4 matrix with the points of tangency. Each row describes
a segment(edge).
INNER
4-by-2 vector with the point of intersection of the inner
tangents (crossed belts) with the segment that joins the
centers of the two circles. If the i-th edge is not an inner
tangent then 'inner(i,:)=[NaN,NaN]'.
Example:
c = [0 0;1 3];
r = [1 0.5];
[T inner] = beltproblem(c,r)
=> T =
-0.68516 0.72839 1.34258 2.63581
0.98516 0.17161 0.50742 2.91419
0.98675 -0.16225 1.49338 2.91888
-0.88675 0.46225 0.55663 3.23112
=> inner =
0.66667 2.00000
0.66667 2.00000
NaN NaN
NaN NaN
See also: edges2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Finds the four lines tangent to two circles with given centers and
radii.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
bisector
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 468
-- Function File: RAY = bisector (LINE1, LINE2)
-- Function File: RAY = bisector (P1, P2, P3)
Return the bisector of two lines, or 3 points.
Creates the bisector of the two lines, given as [x0 y0 dx dy].
create the bisector of lines (P2 P1) and (P2 P3).
The result has the form [x0 y0 dx dy], with [x0 y0] being the
origin point ans [dx dy] being the direction vector, normalized to
have unit norm.
See also: lines2d, rays2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Return the bisector of two lines, or 3 points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
boxes2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 401
-- Function File: boxes2d ()
Description of functions operating on bounding boxes.
A box is represented as a set of limits in each direction:
BOX = [XMIN XMAX YMIN YMAX].
Boxes are used as result of computation for bounding boxes, and to
clip shapes.
See also: clipPoints, clipLine, clipEdge, clipRay, mergeBoxes,
intersectBoxes, randomPointInBox, drawBox.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Description of functions operating on bounding boxes.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
cartesianLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 226
-- Function File: LINE = cartesianLine (A, B,C)
Create a straight line from cartesian equation coefficients.
Create a line verifying the Cartesian equation: A*x + B*x + C = 0;
See also: lines2d, createLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Create a straight line from cartesian equation coefficients.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
cbezier2poly
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1287
-- Function File: PP = cbezier2poly (POINTS)
-- Function File: [X Y] = cbezier2poly (POINTS,T)
Returns the polynomial representation of the cubic Bezier defined
by the control points POINTS.
With only one input argument, calculates the polynomial PP of the
cubic Bezier curve defined by the 4 control points stored in
POINTS. The first point is the inital point of the curve. The
segment joining the first point with the second point (first
center) defines the tangent of the curve at the initial point. The
segment that joints the third point (second center) with the fourth
defines the tanget at the end-point of the curve, which is defined
in the fourth point. POINTS is either a 4-by-2 array (vertical
concatenation of point coordinates), or a 1-by-8 array (horizotnal
concatenation of point coordinates). PP is a 2-by-3 array, 1st row
is the polynomial for the x-coordinate and the 2nd row for the
y-coordinate. Each row can be evaluated with 'polyval'. The
polynomial PP(t) is defined for t in [0,1].
When called with a second input argument T, it returns the
coordinates X and Y corresponding to the polynomial evaluated at T
in [0,1].
See also: drawBezierCurve, polyval.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Returns the polynomial representation of the cubic Bezier defined by the
control
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
centroid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 870
-- Function File: C = centroid (POINTS)
-- Function File: C = centroid (PX, PY)
-- Function File: C = centroid (..., MASS)
Compute centroid (center of mass) of a set of points.
Computes the ND-dimensional centroid of a set of points. POINTS is
an array with as many rows as the number of points, and as many
columns as the number of dimensions. PX and PY are two column
vectors containing coordinates of the 2-dimensional points. The
result C is a row vector with ND columns.
If MASS is given, computes center of mass of POINTS, weighted by
coefficient MASS. POINTS is a Np-by-Nd array, MASS is Np-by-1
array, and PX and PY are also both Np-by-1 arrays.
Example:
pts = [2 2;6 1;6 5;2 4];
centroid(pts)
ans =
4 3
See also: points2d, polygonCentroid.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Compute centroid (center of mass) of a set of points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
circleArcAsCurve
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 767
-- Function File: P = circleArcAsCurve (ARC, N)
Convert a circle arc into a series of points
P = circleArcAsCurve(ARC, N); convert the circle ARC into a series
of N points. ARC is given in the format: [XC YC R THETA1 DTHETA]
where XC and YC define the center of the circle, R its radius,
THETA1 is the start of the arc and DTHETA is the angle extent of
the arc. Both angles are given in degrees. N is the number of
vertices of the resulting polyline, default is 65.
The result is a N-by-2 array containing coordinates of the N
points.
[X Y] = circleArcAsCurve(ARC, N); Return the result in two separate
arrays with N lines and 1 column.
See also: circles2d, circleAsPolygon, drawCircle, drawPolygon.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Convert a circle arc into a series of points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
circleAsPolygon
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 555
-- Function File: P = circleAsPolygon (CIRCLE, N)
Convert a circle into a series of points
P = circleAsPolygon(CIRCLE, N); convert circle given as [x0 y0 r],
where x0 and y0 are coordinate of center, and r is the radius, into
an array of [(N+1)x2] double, containing x and y values of points.
The polygon is closed
P = circleAsPolygon(CIRCLE); uses a default value of N=64 points
Example circle = circleAsPolygon([10 0 5], 16); figure;
drawPolygon(circle);
See also: circles2d, polygons2d, createCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Convert a circle into a series of points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
circles2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 903
-- Function File: circles2d ()
Description of functions operating on circles
Circles are represented by their center and their radius: C = [xc
yc r]; One sometimes considers orientation of circle, by adding an
extra boolean value in 4-th position, with value TRUE for direct
(i.e. turning Counter-clockwise) circles.
Circle arcs are represented by their center, their radius, the
starting angle and the angle extent, both in degrees: CA = [xc yc r
theta0 dtheta];
Ellipses are represented by their center, their 2 semi-axis length,
and their angle (in degrees) with Ox direction. E = [xc yc A B
theta];
See also: ellipses2d, createCircle, createDirectedCircle,
enclosingCircle isPointInCircle, isPointOnCircle
intersectLineCircle, intersectCircles, radicalAxis circleAsPolygon,
circleArcAsCurve drawCircle, drawCircleArc.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Description of functions operating on circles
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
clipEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 400
-- Function File: EDGE2 = clipEdge (EDGE, BOX)
Clip an edge with a rectangular box.
EDGE: [x1 y1 x2 y2], BOX : [xmin xmax ; ymin ymax] or [xmin xmax
ymin ymax]; return : EDGE2 = [xc1 yc1 xc2 yc2];
If clipping is null, return [0 0 0 0];
if EDGE is a [nx4] array, return an [nx4] array, corresponding to
each clipped edge.
See also: edges2d, boxes2d, clipLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Clip an edge with a rectangular box.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
clipLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 888
-- Function File: EDGE = clipLine (LINE, BOX)
Clip a line with a box.
LINE is a straight line given as a 4 element row vector: [x0 y0 dx
dy], with (x0 y0) being a point of the line and (dx dy) a direction
vector, BOX is the clipping box, given by its extreme coordinates:
[xmin xmax ymin ymax]. The result is given as an edge, defined by
the coordinates of its 2 extreme points: [x1 y1 x2 y2]. If line
does not intersect the box, [NaN NaN NaN NaN] is returned.
Function works also if LINE is a Nx4 array, if BOX is a Nx4 array,
or if both LINE and BOX are Nx4 arrays. In these cases, EDGE is a
Nx4 array.
Example:
line = [30 40 10 0];
box = [0 100 0 100];
res = clipLine(line, box)
res =
0 40 100 40
See also: lines2d, boxes2d, edges2d, clipEdge, clipRay.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Clip a line with a box.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
clipPoints
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
-- Function File: POINTS2 = clipPoints (POINTS, BOX)
Clip a set of points by a box.
Returns the set POINTS2 which are located inside of the box BOX.
See also: points2d, boxes2d, clipLine, drawPoint.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Clip a set of points by a box.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
clipRay
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 735
-- Function File: [EDGE INSIDE] = clipRay (RAY, BOX)
Clip a ray with a box.
RAY is a straight ray given as a 4 element row vector: [x0 y0 dx
dy], with (x0 y0) being the origin of the ray and (dx dy) its
direction vector, BOX is the clipping box, given by its extreme
coordinates: [xmin xmax ymin ymax]. The result is given as an edge,
defined by the coordinates of its 2 extreme points: [x1 y1 x2 y2].
If the ray does not intersect the box, [NaN NaN NaN NaN] is
returned.
Function works also if RAY is a Nx4 array, if BOX is a Nx4 array,
or if both RAY and BOX are Nx4 arrays. In these cases, EDGE is a
Nx4 array.
See also: rays2d, boxes2d, edges2d, clipLine, drawRay.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Clip a ray with a box.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
closed_path
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
-- Function File: Y = polygon (X)
Returns a simple closed path that passes through all the points in
X. X is a vector containing 2D coordinates of the points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Returns a simple closed path that passes through all the points in X.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
cov2ellipse
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 685
-- Function File: ELLIPSE = cov2ellipse (K)
-- Function File: [RA RB THETA] = cov2ellipse (K)
-- Function File: ... = cov2ellipse (..., 'tol',TOL)
Calculates ellipse parameters from covariance matrix.
K must be symmetric positive (semi)definite. The optional argument
'tol' sets the tolerance for the verification of the
positive-(semi)definiteness of the matrix K (see 'isdefinite').
If only one output argument is supplied a vector defining a ellipse
is returned as defined in 'ellipses2d'. Otherwise the angle THETA
is given in radians.
Run 'demo cov2ellipse' to see an example.
See also: ellipses2d, cov2ellipse, drawEllipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Calculates ellipse parameters from covariance matrix.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
crackPattern
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 877
-- Function File: E = crackPattern (BOX, POINTS, ALPHA)
Create a (bounded) crack pattern tessellation
E = crackPattern2(BOX, POINTS, ALPHA) create a crack propagation
pattern wit following parameters : - pattern is bounded by area BOX
which is a polygon. - each crack originates from points given in
POINTS - directions of each crack is given by a [NxM] array ALPHA,
where M is the number of rays emanating from each seed/ - a crack
stop when it reaches another already created crack. - all cracks
stop when they reach the border of the frame, given by box (a serie
of 4 points). The result is a collection of edges, in the form [x1
y1 x2 y2].
E = crackPattern2(BOX, POINTS, ALPHA, SPEED) Also specify speed of
propagation of each crack.
See the result with : figure; drawEdge(E);
See also: drawEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Create a (bounded) crack pattern tessellation
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
crackPattern2
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 878
-- Function File: E = crackPattern2 (BOX, POINTS, ALPHA)
Create a (bounded) crack pattern tessellation
E = crackPattern2(BOX, POINTS, ALPHA) create a crack propagation
pattern wit following parameters : - pattern is bounded by area BOX
which is a polygon. - each crack originates from points given in
POINTS - directions of each crack is given by a [NxM] array ALPHA,
where M is the number of rays emanating from each seed/ - a crack
stop when it reaches another already created crack. - all cracks
stop when they reach the border of the frame, given by box (a serie
of 4 points). The result is a collection of edges, in the form [x1
y1 x2 y2].
E = crackPattern2(BOX, POINTS, ALPHA, SPEED) Also specify speed of
propagation of each crack.
See the result with : figure; drawEdge(E);
See also: drawEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Create a (bounded) crack pattern tessellation
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
createBasisTransform
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1391
-- Function File: T = createBasisTransfrom (TARGET)
-- Function File: T = createBasisTransfrom (SOURCE, TARGET)
Compute matrix for transforming a basis into another basis
With only one input arguemnt, assumes the SOURCE is the standard
(Oij) basis, with origin at (0,0), first direction vector equal to
(1,0) and second direction vector equal to (0,1). Otherwise SOURCE
specifies the SOURCE basis.
Both SOURCE and TARGET represent basis, in the following form: [x0
y0 ex1 ey1 ex2 ey2] [y0 y0] is the origin of the basis, [ex1 ey1]
is the first direction vector, and [ex2 ey2] is the second
direction vector.
The result T is a 3-by-3 matrix such that a point expressed with
coordinates of the first basis will be represented by new
coordinates 'P2 = transformPoint(P1, T)' in the TARGET basis.
Example
# standard basis transform
src = [0 0 1 0 0 1];
# TARGET transform, just a rotation by atan(2/3) followed by a scaling
tgt = [0 0 .75 .5 -.5 .75];
# compute transform
trans = createBasisTransform(src, tgt);
# transform the point (.25,1.25) into the point (1,1)
p1 = [.25 1.25];
p2 = transformPoint(p1, trans)
ans =
1 1
See also: transforms2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Compute matrix for transforming a basis into another basis
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
createCircle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 874
-- Function File: CIRCLE = createCircle (P1, P2, P3)
-- Function File: CIRCLE = createCircle (P1, P2)
Create a circle from 2 or 3 points.
Creates the circle passing through the 3 given points. C is a 1x3
array of the form: [XC YX R].
When two points are given, creates the circle whith center P1 and
passing throuh the point P2.
Works also when input are point arrays the same size, in this case
the result has as many lines as the point arrays.
Example
# Draw a circle passing through 3 points.
p1 = [10 15];
p2 = [15 20];
p3 = [10 25];
circle = createCircle(p1, p2, p3);
figure; hold on; axis equal; axis([0 50 0 50]);
drawPoint([p1 ; p2; p3]);
drawCircle(circle);
See also: circles2d, createDirectedCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Create a circle from 2 or 3 points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
createDirectedCircle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 562
-- Function File: CIRCLE = createDirectedCircle (P1, P2, P3)
-- Function File: CIRCLE = createDirectedCircle (P1, P2)
Create a circle from 2 or 3 points.
Creates the circle passing through the 3 given points. C is a 1x4
array of the form: [XC YX R INV].
When two points are given, creates the circle whith center P1 and
passing throuh the point P2.
Works also when input are point arrays the same size, in this case
the result has as many lines as the point arrays.
Example
See also: circles2d, createCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Create a circle from 2 or 3 points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
createEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1081
-- Function File: EDGE = createEdge (P1, P2)
-- Function File: EDGE = createEdge (X0, Y0, DX, DY)
-- Function File: EDGE = createEdge (PARAM)
-- Function File: EDGE = createEdge (LINE, D)
Create an edge between two points, or from a line.
The internal format for edge representation is given by coordinates
of two points : [x1 y1 x2 y2]. This function can serve as a line to
edge converter.
Returns the edge between the two given points P1 and P2.
Returns the edge going through point (X0, Y0) and with direction
vector (DX,DY).
When PARAM is an array of 4 values, creates the edge going through
the point (param(1) param(2)), and with direction vector given by
(param(3) param(4)).
When LINE is given, creates the edge contained in LINE, with same
direction and start point, but with length given by D.
Note: in all cases, parameters can be vertical arrays of the same
dimension. The result is then an array of edges, of dimensions
[N*4].
See also: edges2d, lines2d, drawEdge, clipEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Create an edge between two points, or from a line.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
createHomothecy
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
-- Function File: T = createHomothecy (POINT, RATIO)
Create the the 3x3 matrix of an homothetic transform.
POINT is the center of the homothecy, RATIO is its factor.
See also: transforms2d, transformPoint, createTranslation.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Create the the 3x3 matrix of an homothetic transform.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
createLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2288
-- Function File: LINE = createLine(varargin)
Create a straight line from 2 points, or from other inputs
Line is represented in a parametric form : [x0 y0 dx dy] x = x0 +
t*dx y = y0 + t*dy;
L = createLine(p1, p2); Returns the line going through the two
given points.
L = createLine(x0, y0, dx, dy); Returns the line going through
point (x0, y0) and with direction vector(dx, dy).
L = createLine(LINE); where LINE is an array of 4 values, creates
the line going through the point (LINE(1) LINE(2)), and with
direction given by vector (LINE(3) LINE(4)).
L = createLine(THETA); Create a polar line originated at (0,0) and
with angle THETA.
L = createLine(RHO, THETA); Create a polar line with normal theta,
and with min distance to origin equal to rho. rho can be negative,
in this case, the line is the same as with CREATELINE(-rho,
theta+pi), but the orientation is different.
Note: in all cases, parameters can be vertical arrays of the same
dimension. The result is then an array of lines, of dimensions
[N*4].
NOTE : A line can also be represented with a 1*5 array : [x0 y0 dx
dy t]. whith 't' being one of the following : - t=0 : line is a
singleton (x0,y0) - t=1 : line is an edge segment, between points
(x0,y0) and (x0+dx, y0+dy). - t=Inf : line is a Ray, originated
from (x0,y0) and going to infinity in the direction(dx,dy). -
t=-Inf : line is a Ray, originated from (x0,y0) and going to
infinity in the direction(-dx,-dy). - t=NaN : line is a real
straight line, and contains all points verifying the above
equation. This seems us a convenient way to represent uniformly all
kind of lines (including edges, rays, and even point).
NOTE2 : Any line object can be represented using a 1x6 array : [x0
y0 dx dy t0 t1] the first 4 parameters define the supporting line,
t0 represent the position of the first point on the line, and t1
the position of the last point. * for edges : t0 = 0, and t1=1 *
for straight lines : t0 = -inf, t1=inf * for rays : t0=0, t1=inf
(or t0=-inf,t1=0 for inverted ray). I propose to call these objects
'lineArc'
See also: lines2d, createEdge, createRay.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Create a straight line from 2 points, or from other inputs
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
createLineReflection
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 331
-- Function File: T = function_name (LINE)
Create the the 3x3 matrix of a line reflection.
Where LINE is given as [x0 y0 dx dy], return the affine tansform
corresponding to the desired line reflection.
See also: lines2d, transforms2d, transformPoint, createTranslation,
createHomothecy, createScaling.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Create the the 3x3 matrix of a line reflection.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
createRay
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 855
-- Function File: RAY = createRay (POINT, ANGLE)
-- Function File: RAY = createRay (X0,Y0, ANGLE)
-- Function File: RAY = createRay (P1, P2)
Create a ray (half-line), from various inputs.
A Ray is represented in a parametric form: [x0 y0 dx dy]. x = x0 +
t*dx y = y0 + t*dy; for all t>0.
POINT is a Nx2 array giving the starting point of the ray, and
ANGLE is the orientation of the ray respect to the positive x-axis.
The ray origin can be specified with 2 input arguments X0,Y0.
If two points P1, P2 are given, creates a ray starting from point
P1 and going in the direction of point P2.
Example
origin = [3 4];
theta = pi/6;
ray = createRay(origin, theta);
axis([0 10 0 10]);
drawRay(ray);
See also: rays2d, createLine, points2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Create a ray (half-line), from various inputs.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
createRotation
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 620
-- Function File: T = createRotation (THETA)
-- Function File: T = createRotation (POINT, THETA)
-- Function File: T = createRotation (X0, Y0, THETA)
Create the 3*3 matrix of a rotation.
Returns the rotation corresponding to angle THETA (in radians) The
returned matrix has the form : [cos(theta) -sin(theta) 0]
[sin(theta) cos(theta) 0] [0 0 1]
POINT or (X0,Y0), specifies origin of rotation. The result is
similar as performing translation(-X0,-Y0), rotation(THETA), and
translation(X0,Y0).
See also: transforms2d, transformPoint, createTranslation,
createScaling.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Create the 3*3 matrix of a rotation.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
createScaling
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 453
-- Function File: T = createScaling (S)
-- Function File: T = createScaling (SX, SY)
Create the 3x3 matrix of a scaling in 2 dimensions.
Assume scaling S is equal n all directions unless SX and SY are
given. Returns the matrix corresponding to scaling in the 2 main
directions. The returned matrix has the form: [SX 0 0] [0 SY 0] [0
0 1]
See also: transforms2d, transformPoint, createTranslation,
createRotation.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Create the 3x3 matrix of a scaling in 2 dimensions.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
createTranslation
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 423
-- Function File: T = createTranslation (VECTOR)
-- Function File: T = createTranslation (DX,DY)
Create the 3*3 matrix of a translation.
Returns the matrix corresponding to a translation by the vector [DX
DY]. The components can be given as two arguments. The returned
matrix has the form : [1 0 TX] [0 1 TY] [0 0 1]
See also: transforms2d, transformPoint, createRotation,
createScaling.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Create the 3*3 matrix of a translation.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
createVector
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 547
-- Function File: VECT = createVector (P1, P2)
Create a vector from two points.
V12 = createVector(P1, P2) Creates the vector V12, defined as the
difference between coordinates of points P1 and P2. P1 and P2 are
row vectors with ND elements, ND being the space dimension.
If one of the inputs is a N-by-Nd array, the other input is
automatically repeated, and the result is N-by-Nd.
If both inputs have the same size, the result also have the same
size.
See also: vectors2d, vectors3d, points2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Create a vector from two points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
deg2rad
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 297
-- Function File: RAD = deg2rad( DEG)
Convert angle from degrees to radians
Usage: R = deg2rad(D) convert an angle in degrees to an angle in
radians.
Example deg2rad(180) # gives pi ans = 3.1416 deg2rad(60) # gives
pi/3 ans = 1.0472
See also: angles2d, rad2deg.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Convert angle from degrees to radians
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
distancePointEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1247
-- Function File: DIST = distancePointEdge (POINT, EDGE)
-- Function File: DIST = distancePointEdge (..., OPT)
-- Function File: [DIST POS]= distancePointEdge (...)
Minimum distance between a point and an edge
Return the euclidean distance between edge EDGE and point POINT.
EDGE has the form: [x1 y1 x2 y2], and POINT is [x y]. If EDGE is
Ne-by-4 and POINT is Np-by-2, then DIST is Np-by-Ne, where each row
contains the distance of each point to all the edges.
If OPT is true (or equivalent), the optput is cmpatible with the
original function:
'1'
If POINT is 1-by-2 array, the result is Ne-by-1 array computed
for each edge.
'2'
If EDGE is a 1-by-4 array, the result is Np-by-1 computed for
each point.
'3'
If both POINT and EDGE are array, they must have the same
number of rows, and the result is computed for each couple
'POINT(i,:),EDGE(i,:)'.
If the the second output argument POS is requested, the function
also returns the position of closest point on the edge. POS is
comprised between 0 (first point) and 1 (last point).
See also: edges2d, points2d, distancePoints, distancePointLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Minimum distance between a point and an edge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
distancePointLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 610
-- Function File: DIST = distancePointLine (POINT, LINE)
Minimum distance between a point and a line
D = distancePointLine(POINT, LINE) Return the euclidean distance
between line LINE and point POINT.
LINE has the form : [x0 y0 dx dy], and POINT is [x y].
If LINE is N-by-4 array, result is N-by-1 array computes for each
line.
If POINT is N-by-2, then result is computed for each point.
If both POINT and LINE are array, result is N-by-1, computed for
each corresponding point and line.
See also: lines2d, points2d, distancePoints, distancePointEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Minimum distance between a point and a line
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
drawArrow
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 675
-- Function File: H = drawArrow (X1, Y1, X2, Y2)
-- Function File: H = drawArrow ([ X1 Y1 X2 Y2])
-- Function File: H = drawArrow (..., L, W)
-- Function File: H = drawArrow (..., L, W,TYPE)
Draw an arrow on the current axis.
draw an arrow between the points (X1 Y1) and (X2 Y2). The points
can be given as a single array. L, W specify length and width of
the arrow.
Also specify arrow type. TYPE can be one of the following : 0:
draw only two strokes 1: fill a triangle .5: draw a half arrow (try
it to see ...)
Arguments can be single values or array of size [N*1]. In this
case, the function draws multiple arrows.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Draw an arrow on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
drawBezierCurve
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1048
-- Function File: drawBezierCurve ( POINTS)
-- Function File: drawBezierCurve ( PP)
-- Function File: drawBezierCurve ( ..., PARAM, VALUE, ...)
-- Function File: H = drawBezierCurve (...)
Draw a cubic bezier curve defined by the control points POINTS.
With only one input argument, draws the Bezier curve defined by the
4 control points stored in POINTS. POINTS is either a 4-by-2 array
(vertical concatenation of point coordinates), or a 1-by-8 array
(horizotnal concatenation of point coordinates). The curve could
be described by its polynomial (output of 'cbezier2poly') PP, which
should be a 2-by-4 array.
The optional PARAM, VALUE pairs specify additional drawing
parameters, see the 'plot' function for details. The specific
parameter 'discretization' with an integer associated value defines
the amount of points used to plot the curve. If the output is
requiered, the function returns the handle to the created graphic
object.
See also: cbezier2poly, plot.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Draw a cubic bezier curve defined by the control points POINTS.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
drawBox
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 389
-- Function File: H = drawBox (BOX)
-- Function File: H = drawBox (BOX, PARAM, VALUE, ...)
Draw a box defined by coordinate extents
Draws a box defined by its extent: BOX = [XMIN XMAX YMIN YMAX].
Addtional arguments are passed to function 'plot'. If requested,
it returns the handle to the graphics object created.
See also: drawOrientedBox, drawRect, plot.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Draw a box defined by coordinate extents
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
drawCenteredEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1316
-- Function File: H = drawCenteredEdge (CENTER, L, THETA)
-- Function File: H = drawCenteredEdge (EDGE)
-- Function File: H = drawCenteredEdge (..., NAME,VALUE)
Draw an edge centered on a point.
drawCenteredEdge(CENTER, L, THETA) Draws an edge centered on point
CENTER, with length L, and orientation THETA (given in degrees).
Input arguments can also be arrays, that must all have the same
number odf rows.
drawCenteredEdge(EDGE) Concatenates edge parameters into a single
N-by-4 array, containing: [XC YV L THETA].
drawCenteredEdge(..., NAME, VALUE) Also specifies drawing options
by using one or several parameter name - value pairs (see doc of
plot function for details).
H = drawCenteredEdge(...) Returns handle(s) to the created
edges(s).
# Draw an ellipse with its two axes
figure(1); clf;
center = [50 40];
r1 = 30; r2 = 10;
theta = 20;
elli = [center r1 r2 theta];
drawEllipse(elli, 'linewidth', 2);
axis([0 100 0 100]); axis equal;
hold on;
edges = [center 2*r1 theta ; center 2*r2 theta+90];
drawCenteredEdge(edges, 'linewidth', 2, 'color', 'g');
See also: edges2d, drawEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Draw an edge centered on a point.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawCircle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1115
-- Function File: H = drawCircle (X0, Y0, R)
-- Function File: H = drawCircle (CIRCLE)
-- Function File: H = drawCircle (CENTER, RADIUS)
-- Function File: H = drawCircle (..., NSTEP)
-- Function File: H = drawCircle (..., NAME, VALUE)
Draw a circle on the current axis
drawCircle(X0, Y0, R); Draw the circle with center (X0,Y0) and the
radius R. If X0, Y0 and R are column vectors of the same length,
draw each circle successively.
drawCircle(CIRCLE); Concatenate all parameters in a Nx3 array,
where N is the number of circles to draw.
drawCircle(CENTER, RADIUS); Specify CENTER as Nx2 array, and radius
as a Nx1 array.
drawCircle(..., NSTEP); Specify the number of edges that will be
used to draw the circle. Default value is 72, creating an
approximation of one point for each 5 degrees.
drawCircle(..., NAME, VALUE); Specifies plotting options as pair of
parameters name/value. See plot documentation for details.
H = drawCircle(...); return handles to each created curve.
See also: circles2d, drawCircleArc, drawEllipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Draw a circle on the current axis
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
drawCircleArc
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 987
-- Function File: H = drawCircleArc (XC, YC, R, START, END)
-- Function File: H = drawCircleArc (ARC)
-- Function File: H = drawCircleArc (..., PARAM, VALUE)
Draw a circle arc on the current axis
drawCircleArc(XC, YC, R, START, EXTENT); Draws circle with center
(XC, YC), with radius R, starting from angle START, and with
angular extent given by EXTENT. START and EXTENT angles are given
in degrees.
drawCircleArc(ARC); Puts all parameters into one single array.
drawCircleArc(..., PARAM, VALUE); specifies plot properties by
using one or several parameter name-value pairs.
H = drawCircleArc(...); Returns a handle to the created line
object.
# Draw a red thick circle arc
arc = [10 20 30 -120 240];
figure;
axis([-50 100 -50 100]);
hold on
drawCircleArc(arc, 'LineWidth', 3, 'Color', 'r')
See also: circles2d, drawCircle, drawEllipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Draw a circle arc on the current axis
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 884
-- Function File: H = drawEdge (X1, Y1, X2, Y2)
-- Function File: H = drawEdge ([X1 Y1 X2 Y2])
-- Function File: H = drawEdge ([X1 Y1], [X2 Y2])
-- Function File: H = drawEdge (X1, Y1, Z1, X2, Y2, Z2)
-- Function File: H = drawEdge ([X1 Y1 Z1 X2 Y2 Z2])
-- Function File: H = drawEdge ([X1 Y1 Z1], [X2 Y2 Z2])
-- Function File: H = drawEdge (..., OPT)
Draw an edge given by 2 points.
Draw an edge between the points (x1 y1) and (x2 y2). Data can be
bundled as an edge. The function supports 3D edges. Arguments can
be single values or array of size [Nx1]. In this case, the
function draws multiple edges. OPT, being a set of pairwise
options, can specify color, line width and so on. These are passed
to function 'line'. The function returns handle(s) to created
edges(s).
See also: edges2d, drawCenteredEdge, drawLine, line.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Draw an edge given by 2 points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
drawEllipse
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1309
-- Function File: H = drawEllipse (ELLI)
-- Function File: H = drawEllipse (XC, YC, RA, RB)
-- Function File: H = drawEllipse (XC, YC, RA, RB, THETA)
-- Function File: H = drawEllipse (..., PARAM, VALUE)
Draw an ellipse on the current axis.
drawEllipse(ELLI); Draws the ellipse ELLI in the form [XC YC RA RB
THETA], with center (XC, YC), with main axis of half-length RA and
RB, and orientation THETA in degrees counted counter-clockwise.
Puts all parameters into one single array.
drawEllipse(XC, YC, RA, RB); drawEllipse(XC, YC, RA, RB, THETA);
Specifies ellipse parameters as separate arguments (old syntax).
drawEllipse(..., NAME, VALUE); Specifies drawing style of ellipse,
see the help of plot function.
H = drawEllipse(...); Also returns handles to the created line
objects.
-> Parameters can also be arrays. In this case, all arrays are
supposed to have the same size.
Example:
# Draw an ellipse centered in [50 50], with semi major axis length of
# 40, semi minor axis length of 20, and rotated by 30 degrees.
figure(1); clf; hold on;
drawEllipse([50 50 40 20 30]);
axis equal;
See also: ellipses2d, drawCircle, drawEllipseArc, ellipseAsPolygon.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Draw an ellipse on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
drawEllipseArc
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1313
-- Function File: H = drawEllipseArc (ARC)
Draw an ellipse arc on the current axis.
drawEllipseArc(ARC) draw ellipse arc specified by ARC. ARC has the
format: ARC = [XC YC A B THETA T1 T2] or: ARC = [XC YC A B T1 T2]
(isothetic ellipse) with center (XC, YC), main axis of half-length
A, second axis of half-length B, and ellipse arc running from t1 to
t2 (both in degrees, in Counter-Clockwise orientation).
Parameters can also be arrays. In this case, all arrays are
suposed to have the same size...
# draw an ellipse arc: center = [10 20], radii = 50 and 30, theta = 45
arc = [10 20 50 30 45 -90 270];
figure;
axis([-50 100 -50 100]); axis equal;
hold on
drawEllipseArc(arc, 'color', 'r')
# draw another ellipse arc, between angles -60 and 70
arc = [10 20 50 30 45 -60 (60+70)];
figure;
axis([-50 100 -50 100]); axis equal;
hold on
drawEllipseArc(arc, 'LineWidth', 2);
ray1 = createRay([10 20], deg2rad(-60+45));
drawRay(ray1)
ray2 = createRay([10 20], deg2rad(70+45));
drawRay(ray2)
See also: ellipses2d, drawEllipse, drawCircleArc.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Draw an ellipse arc on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawLabels
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 671
-- Function File: drawLabels ( X, Y, LBL)
-- Function File: drawLabels ( POS, LBL)
-- Function File: drawLabels ( ..., NUMBERS, FORMAT)
Draw labels at specified positions.
DRAWLABELS(X, Y, LBL) draw labels LBL at position X and Y. LBL can
be either a string array, or a number array. In this case, string
are created by using sprintf function, with '#.2f' mask.
DRAWLABELS(POS, LBL) draw labels LBL at position specified by POS,
where POS is a N*2 int array.
DRAWLABELS(..., NUMBERS, FORMAT) create labels using sprintf
function, with the mask given by FORMAT (e. g. '#03d' or '5.3f'),
and the corresponding values.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Draw labels at specified positions.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 652
-- Function File: H = drawLine (LINE)
-- Function File: H = drawLine (LINE, PARAM,VALUE)
Draw the line on the current axis.
Draws the line LINE on the current axis, by using current axis to
clip the line. Extra PARAM,VALUE pairs are passed to the 'line'
function. Returns a handle to the created line object. If clipped
line is not contained in the axis, the function returns -1.
Example
figure; hold on; axis equal;
axis([0 100 0 100]);
drawLine([30 40 10 20]);
drawLine([30 40 20 -10], 'color', 'm', 'linewidth', 2);
See also: lines2d, createLine, drawEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Draw the line on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
drawOrientedBox
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 796
-- Function File: HB = drawOrientedBox (BOX)
-- Function File: HB = drawOrientedBox (..., PARAM, VALUE)
Draw centered oriented rectangle.
Syntax drawOrientedBox(BOX) drawOrientedBox(BOX, 'PropertyName',
propertyvalue, ...)
Description drawOrientedBox(OBOX) Draws an oriented rectangle (or
bounding box) on the current axis. OBOX is a 1-by-5 row vector
containing box center, dimension (length and width) and orientation
(in degrees): OBOX = [CX CY LENGTH WIDTH THETA].
When OBOX is a N-by-5 array, the N boxes are drawn.
HB = drawOrientedBox(...) Returns a handle to the created graphic
object(s). Object style can be modified using syntaw like: set(HB,
'color', 'g', 'linewidth', 2);
See also: drawPolygon, drawRect, drawBox.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Draw centered oriented rectangle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawParabola
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1471
-- Function File: H = drawParabola (PARABOLA)
-- Function File: H = drawParabola (PARABOLA, T)
-- Function File: H = drawParabola (..., PARAM, VALUE)
Draw a parabola on the current axis.
drawParabola(PARABOLA); Draws a vertical parabola, defined by its
vertex and its parameter. Such a parabola admits a vertical axis of
symetry.
The algebraic equation of parabola is given by: (Y - YV) = A * (X -
VX)^2 Where XV and YV are vertex coordinates and A is parabola
parameter.
A parametric equation of parabola is given by: x(t) = t + VX; y(t)
= A * t^2 + VY;
PARABOLA can also be defined by [XV YV A THETA], with theta being
the angle of rotation of the parabola (in degrees and
Counter-Clockwise).
drawParabola(PARABOLA, T); Specifies which range of 't' are used
for drawing parabola. If T is an array with only two values, the
first and the last values are used as interval bounds, and several
values are distributed within this interval.
drawParabola(..., NAME, VALUE); Can specify one or several
graphical options using parameter name-value pairs.
H = drawParabola(...); Returns an handle to the created graphical
object.
Example:
figure(1); clf; hold on;
drawParabola([50 50 .2 30]);
drawParabola([50 50 .2 30], [-1 1], 'color', 'r', 'linewidth', 2);
axis equal;
See also: drawCircle, drawEllipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Draw a parabola on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
drawPoint
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 421
-- Function File: H = drawPoint (X, Y)
-- Function File: H = drawPoint (COORD)
-- Function File: H = drawPoint (..., OPT)
Draw the point on the axis.
Draws points defined by coordinates X and Y. X and Y should be
array the same size. Coordinates can be packed coordinates in a
single [N*2] array COORD. Options OPT are passed to the 'plot'
function.
See also: points2d, clipPoints.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Draw the point on the axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
drawRay
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 393
-- Function File: H = drawRay (RAY)
-- Function File: H = drawRay (RAY, PARAM, VALUE)
Draw a ray on the current axis.
With RAY having the syntax: [x0 y0 dx dy], draws the ray starting
from point (x0 y0) and going to direction (dx dy), clipped with the
current window axis. PARAM, VALUE pairs are passed to function
'line'.
See also: rays2d, drawLine, line.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Draw a ray on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawRect
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 666
-- Function File: R = drawRect (X, Y, W, H)
-- Function File: R = drawRect (X, Y, W, H, THETA)
-- Function File: R = drawRect (COORD)
Draw rectangle on the current axis.
r = DRAWRECT(x, y, w, h) draw rectangle with width W and height H,
at position (X, Y). the four corners of rectangle are then : (X,
Y), (X+W, Y), (X, Y+H), (X+W, Y+H).
r = DRAWRECT(x, y, w, h, theta) also specifies orientation for
rectangle. Theta is given in degrees.
r = DRAWRECT(coord) is the same as DRAWRECT(X,Y,W,H), but all
parameters are packed into one array, whose dimensions is 4*1 or
5*1.
See also: drawBox, drawOrientedBox.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Draw rectangle on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
drawShape
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 815
-- Function File: drawShape ( TYPE, PARAM)
-- Function File: drawShape ( ..., OPTION)
Draw various types of shapes (circles, polygons...).
drawShape(TYPE, PARAM) Draw the shape of type TYPE, specified by
given parameter PARAM. TYPE can be one of 'circle', 'ellipse',
'rect', 'polygon', 'curve' PARAM depend on the type. For example,
if TYPE is 'circle', PARAM will contain [x0 y0 R].
Examples :
drawShape('circle', [20 10 30]);
Draw circle centered on [20 10] with radius 10.
drawShape('rect', [20 20 40 10 pi/3]);
Draw rectangle centered on [20 20] with length 40 and width 10, and
oriented pi/3 wrt axis Ox.
drawShape(..., OPTION) also specifies drawing options. OPTION can
be 'draw' (default) or 'fill'.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Draw various types of shapes (circles, polygons...).
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
edgeAngle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 492
-- Function File: THETA = edgeAngle( EDGE)
Return angle of edge
A = edgeAngle(EDGE) Returns the angle between horizontal,
right-axis and the edge EDGE. Angle is given in radians, between 0
and 2*pi, in counter-clockwise direction. Notation for edge is [x1
y1 x2 y2] (coordinates of starting and ending points).
Example p1 = [10 20]; p2 = [30 40]; rad2deg(edgeAngle([p1 p2])) ans
= 45
See also: edges2d, angles2d, edgeAngle, lineAngle, edgeLength.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Return angle of edge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
edgeLength
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 428
-- Function File: LEN = edgeLength (EDGE)
Return length of an edge
L = edgeLength(EDGE); Returns the length of an edge, with
parametric representation: [x1 y1 x2 y2].
The function also works for several edges, in this case input is a
[N*4] array, containing parametric representation of each edge, and
output is a [N*1] array containing length of each edge.
See also: edges2d, edgeAngle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Return length of an edge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
edgePosition
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1136
-- Function File: D = edgePosition (POINT, EDGE)
Return position of a point on an edge
POS = edgePosition(POINT, EDGE); Computes position of point POINT
on the edge EDGE, relative to the position of edge vertices. EDGE
has the form [x1 y1 x2 y2], POINT has the form [x y], and is
assumed to belong to edge. The position POS has meaning: POS<0:
POINT is located before the first vertex POS=0: POINT is located on
the first vertex 0<POS<1: POINT is located between the 2 vertices
(on the edge) POS=1: POINT is located on the second vertex POS<0:
POINT is located after the second vertex
POS = edgePosition(POINT, EDGES); If EDGES is an array of NL edges,
return NL positions, corresponding to each edge.
POS = edgePosition(POINTS, EDGE); If POINTS is an array of NP
points, return NP positions, corresponding to each point.
POS = edgePosition(POINTS, EDGES); If POINTS is an array of NP
points and edgeS is an array of NL edges, return an array of [NP
NL] position, corresponding to each couple point-edge.
See also: edges2d, createEdge, onEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Return position of a point on an edge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
edgeToLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 359
-- Function File: LINE = edgeToLine (EDGE)
Convert an edge to a straight line
LINE = edgeToLine(EDGE); Returns the line containing the edge EDGE.
Example edge = [2 3 4 5]; line = edgeToLine(edge); figure(1); hold
on; axis([0 10 0 10]); drawLine(line, 'color', 'g') drawEdge(edge,
'linewidth', 2)
See also: edges2d, lines2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Convert an edge to a straight line
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
edges2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 477
-- Function File: edges2d ()
Description of functions operating on planar edges
An edge is represented by the corodinate of its end points: EDGE =
[X1 Y1 X2 Y2];
A set of edges is represented by a N*4 array, each row representing
an edge.
See also: lines2d, rays2d, points2d createEdge, edgeAngle,
edgeLength, edgeToLine, midPoint intersectEdges, intersectLineEdge,
isPointOnEdge clipEdge, transformEdge drawEdge, drawCenteredEdge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Description of functions operating on planar edges
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
ellipse2cov
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 669
-- Function File: K = ellipse2cov (ELLI)
-- Function File: K = ellipse2cov (RA, RB)
-- Function File: K = ellipse2cov (..., THETA)
Calculates covariance matrix from ellipse.
If only one input is given, ELLI must define an ellipse as
described in 'ellipses2d'. If two inputs are given, RA and RB
define the half-lenght of the axes. If a third input is given,
THETA must be the angle of rotation of the ellipse in radians, and
in counter-clockwise direction.
The output K contains the covariance matrix define by the ellipse.
Run 'demo ellipse2cov' to see an example.
See also: ellipses2d, cov2ellipse, drawEllipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Calculates covariance matrix from ellipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
ellipseAsPolygon
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 716
-- Function File: P = ellipseAsPolygon (ELL, N)
Convert an ellipse into a series of points
P = ellipseAsPolygon(ELL, N); converts ELL given as [x0 y0 a b] or
[x0 y0 a b theta] into a polygon with N edges. The result P is
(N+1)-by-2 array containing coordinates of the N+1 vertices of the
polygon. The resulting polygon is closed, i.e. the last point is
the same as the first one.
P = ellipseAsPolygon(ELL); Use a default number of edges equal to
72. This result in one piont for each 5 degrees.
[X Y] = ellipseAsPolygon(...); Return the coordinates o fvertices
in two separate arrays.
See also: ellipses2d, circleAsPolygon, rectAsPolygon, drawEllipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Convert an ellipse into a series of points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ellipses2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 372
-- Function File: ellipses2d ()
Description of functions operating on ellipses.
Ellipses are represented by their center, the length of their 2
semi-axes length, and their angle from the Ox direction (in
degrees). E = [XC YC A B THETA];
See also: circles2d, inertiaEllipse, isPointInEllipse,
ellipseAsPolygon drawEllipse, drawEllipseArc.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Description of functions operating on ellipses.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
enclosingCircle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 445
-- Function File: CIRCLE = enclosingCircle (PTS)
Find the minimum circle enclosing a set of points.
CIRCLE = enclosingCircle(POINTS); compute cirlce CIRCLE=[xc yc r]
which enclose all points POINTS given as an [Nx2] array.
Rewritten from a file from Yazan Ahed which was rewritten from a
Java applet by Shripad Thite :
<http://heyoka.cs.uiuc.edu/~thite/mincircle/>
See also: circles2d, points2d, boxes2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Find the minimum circle enclosing a set of points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
fitAffineTransform2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 396
-- Function File: T = fitAffineTransform2d (PTS1, PTS2)
Fit an affine transform using two point sets.
Example
N = 10;
pts = rand(N, 2)*10;
trans = createRotation(3, 4, pi/4);
pts2 = transformPoint(pts, trans);
pts3 = pts2 + randn(N, 2)*2;
fitted = fitAffineTransform2d(pts, pts2)
See also: transforms2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Fit an affine transform using two point sets.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
geom2d_Contents
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7795
-- Function File: geom2d_Contents ()
Geometry 2D Toolbox Version 1.2.0 21-Oct-2011 .
Library to handle and visualize geometric primitives such as
points, lines, circles and ellipses, polygons...
The goal is to provide a low-level library for manipulating
geometrical primitives, making easier the development of more
complex geometric algorithms.
Most functions works for planar shapes, but some ones have been
extended to 3D or to any dimension.
Points points2d - Description of functions operating on points
clipPoints - Clip a set of points by a box centroid - Compute
centroid (center of mass) of a set of points midPoint - Middle
point of two points or of an edge isCounterClockwise - Compute
relative orientation of 3 points polarPoint - Create a point from
polar coordinates (rho + theta) angle2Points - Compute horizontal
angle between 2 points angle3Points - Compute oriented angle made
by 3 points angleSort - Sort points in the plane according to their
angle to origin distancePoints - Compute distance between two
points minDistancePoints - Minimal distance between several points
transformPoint - Transform a point with an affine transform
drawPoint - Draw the point on the axis.
Vectors vectors2d - Description of functions operating on plane
vectors createVector - Create a vector from two points vectorNorm -
Compute norm of a vector, or of a set of vectors vectorAngle -
Angle of a vector, or between 2 vectors normalizeVector - Normalize
a vector to have norm equal to 1 isPerpendicular - Check
orthogonality of two vectors isParallel - Check parallelism of two
vectors transformVector - Transform a vector with an affine
transform rotateVector - Rotate a vector by a given angle
Straight lines lines2d - Description of functions operating on
planar lines createLine - Create a straight line from 2 points, or
from other inputs medianLine - Create a median line between two
points cartesianLine - Create a straight line from cartesian
equation coefficients orthogonalLine - Create a line orthogonal to
another one. parallelLine - Create a line parallel to another one.
intersectLines - Return all intersection points of N lines in 2D
lineAngle - Computes angle between two straight lines linePosition
- Position of a point on a line lineFit - Fit a straight line to a
set of points clipLine - Clip a line with a box reverseLine -
Return same line but with opposite orientation transformLine -
Transform a line with an affine transform drawLine - Draw the line
on the current axis
Edges (line segments between 2 points) edges2d - Description of
functions operating on planar edges createEdge - Create an edge
between two points, or from a line edgeToLine - Convert an edge to
a straight line edgeAngle - Return angle of edge edgeLength -
Return length of an edge midPoint - Middle point of two points or
of an edge edgePosition - Return position of a point on an edge
clipEdge - Clip an edge with a rectangular box reverseEdge -
Intervert the source and target vertices of edge intersectEdges -
Return all intersections between two set of edges intersectLineEdge
- Return intersection between a line and an edge transformEdge -
Transform an edge with an affine transform drawEdge - Draw an edge
given by 2 points drawCenteredEdge - Draw an edge centered on a
point
Rays rays2d - Description of functions operating on planar rays
createRay - Create a ray (half-line), from various inputs bisector
- Return the bisector of two lines, or 3 points clipRay - Clip a
ray with a box drawRay - Draw a ray on the current axis
Relations between points and lines distancePointEdge - Minimum
distance between a point and an edge distancePointLine - Minimum
distance between a point and a line projPointOnLine - Project of a
point orthogonally onto a line pointOnLine - Create a point on a
line at a given position on the line isPointOnLine - Test if a
point belongs to a line isPointOnEdge - Test if a point belongs to
an edge isPointOnRay - Test if a point belongs to a ray
isLeftOriented - Test if a point is on the left side of a line
Circles circles2d - Description of functions operating on circles
createCircle - Create a circle from 2 or 3 points
createDirectedCircle - Create a directed circle intersectCircles -
Intersection points of two circles intersectLineCircle -
Intersection point(s) of a line and a circle circleAsPolygon -
Convert a circle into a series of points circleArcAsCurve - Convert
a circle arc into a series of points isPointInCircle - Test if a
point is located inside a given circle isPointOnCircle - Test if a
point is located on a given circle. enclosingCircle - Find the
minimum circle enclosing a set of points. radicalAxis - Compute the
radical axis (or radical line) of 2 circles drawCircle - Draw a
circle on the current axis drawCircleArc - Draw a circle arc on the
current axis
Ellipses ellipses2d - Description of functions operating on
ellipses inertiaEllipse - Inertia ellipse of a set of points
isPointInEllipse - Check if a point is located inside a given
ellipse ellipseAsPolygon - Convert an ellipse into a series of
points drawEllipse - Draw an ellipse on the current axis
drawEllipseArc - Draw an ellipse arc on the current axis
Geometric transforms transforms2d - Description of functions
operating on transforms createTranslation - Create the 3*3 matrix
of a translation createRotation - Create the 3*3 matrix of a
rotation createScaling - Create the 3*3 matrix of a scaling in 2
dimensions createHomothecy - Create the the 3x3 matrix of an
homothetic transform createBasisTransform - Compute matrix for
transforming a basis into another basis createLineReflection -
Create the the 3x3 matrix of a line reflection fitAffineTransform2d
- Fit an affine transform using two point sets
Angles angles2d - Description of functions for manipulating angles
normalizeAngle - Normalize an angle value within a 2*PI interval
angleAbsDiff - Absolute difference between two angles angleDiff -
Difference between two angles deg2rad - Convert angle from degrees
to radians rad2deg - Convert angle from radians to degrees
Boxes boxes2d - Description of functions operating on bounding
boxes intersectBoxes - Intersection of two bounding boxes
mergeBoxes - Merge two boxes, by computing their greatest extent
randomPointInBox - Generate random point within a box drawBox -
Draw a box defined by coordinate extents
Various drawing functions drawBezierCurve - Draw a cubic bezier
curve defined by 4 control points drawParabola - Draw a parabola on
the current axis drawOrientedBox - Draw centered oriented rectangle
drawRect - Draw rectangle on the current axis drawArrow - Draw an
arrow on the current axis drawLabels - Draw labels at specified
positions drawShape - Draw various types of shapes (circles,
polygons...)
Other shapes squareGrid - Generate equally spaces points in plane.
hexagonalGrid - Generate hexagonal grid of points in the plane.
triangleGrid - Generate triangular grid of points in the plane.
crackPattern - Create a (bounded) crack pattern tessellation
crackPattern2 - Create a (bounded) crack pattern tessellation
Credits: * function 'enclosingCircle' rewritten from a file from
Yazan Ahed , available on Matlab File Exchange
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Geometry 2D Toolbox Version 1.2.0 21-Oct-2011 .
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
hexagonalGrid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 446
-- Function File: PTS = hexagonalGrid (BOUNDS, ORIGIN, SIZE)
Generate hexagonal grid of points in the plane.
usage PTS = hexagonalGrid(BOUNDS, ORIGIN, SIZE) generate points,
lying in the window defined by BOUNDS (=[xmin ymin xmax ymax]),
starting from origin with a constant step equal to size. SIZE is
constant and is equals to the length of the sides of each hexagon.
TODO: add possibility to use rotated grid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Generate hexagonal grid of points in the plane.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
inertiaEllipse
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1081
-- Function File: ELL = inertiaEllipse (PTS)
Inertia ellipse of a set of points
ELL = inertiaEllipse(PTS); where PTS is a N*2 array containing
coordinates of N points, computes the inertia ellispe of the set of
points.
The result has the form: ELL = [XC YC A B THETA], with XC and YC
being the center of mass of the point set, A and B are the lengths
of the inertia ellipse (see below), and THETA is the angle of the
main inertia axis with the horizontal (counted in degrees between 0
and 180). A and B are the standard deviations of the point
coordinates when ellipse is aligned with the inertia axes.
pts = randn(100, 2);
pts = transformPoint(pts, createScaling(5, 2));
pts = transformPoint(pts, createRotation(pi/6));
pts = transformPoint(pts, createTranslation(3, 4));
ell = inertiaEllipse(pts);
figure(1); clf; hold on;
drawPoint(pts);
drawEllipse(ell, 'linewidth', 2, 'color', 'r');
See also: ellipses2d, drawEllipse.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Inertia ellipse of a set of points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
intersectBoxes
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 303
-- Function File: BOX = intersectBoxes (BOX1, BOX2)
Intersection of two bounding boxes.
Example
box1 = [5 20 5 30];
box2 = [0 15 0 15];
intersectBoxes(box1, box2)
ans =
5 15 5 15
See also: boxes2d, drawBox, mergeBoxes.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Intersection of two bounding boxes.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
intersectCircles
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1123
-- Function File: POINTS = intersectCircles (CIRCLE1, CIRCLE2)
Intersection points of two circles.
POINTS = intersectCircles(CIRCLE1, CIRCLE2) Computes the
intersetion point of the two circles CIRCLE1 and CIRCLE1. Both
circles are given with format: [XC YC R], with (XC,YC) being the
coordinates of the center and R being the radius. POINTS is a
2-by-2 array, containing coordinate of an intersection point on
each row. In the case of tangent circles, the intersection is
returned twice. It can be simplified by using the 'unique'
function.
Example # intersection points of two distant circles c1 = [0 0 10];
c2 = [10 0 10]; pts = intersectCircles(c1, c2) pts = 5 -8.6603 5
8.6603
# intersection points of two tangent circles c1 = [0 0 10]; c2 =
[20 0 10]; pts = intersectCircles(c1, c2) pts = 10 0 10 0 pts2 =
unique(pts, 'rows') pts2 = 10 0
References http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/
http://mathworld.wolfram.com/Circle-CircleIntersection.html
See also: circles2d, intersectLineCircle, radicalAxis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Intersection points of two circles.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
intersectEdges
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 718
-- Function File: POINT = intersectEdges (EDGE1, EDGE2)
Return all intersections between two set of edges
P = intersectEdges(E1, E2); returns the intersection point of lines
L1 and L2. E1 and E2 are 1-by-4 arrays, containing parametric
representation of each edge (in the form [x1 y1 x2 y2], see
'createEdge' for details).
In case of colinear edges, returns [Inf Inf]. In case of parallel
but not colinear edges, returns [NaN NaN].
If each input is [N*4] array, the result is a [N*2] array
containing intersections of each couple of edges. If one of the
input has N rows and the other 1 row, the result is a [N*2] array.
See also: edges2d, intersectLines.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Return all intersections between two set of edges
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
intersectLineCircle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 718
-- Function File: POINTS = intersectLineCircle (LINE, CIRCLE)
Intersection point(s) of a line and a circle
INTERS = intersectLineCircle(LINE, CIRCLE); Returns a 2-by-2 array,
containing on each row the coordinates of an intersection point.
If the line and circle do not intersect, the result is filled with
NaN.
Example # base point center = [10 0]; # create vertical line l1 =
[center 0 1]; # circle c1 = [center 5]; pts =
intersectLineCircle(l1, c1) pts = 10 -5 10 5 # draw the result
figure; clf; hold on; axis([0 20 -10 10]); drawLine(l1);
drawCircle(c1); drawPoint(pts, 'rx'); axis equal;
See also: lines2d, circles2d, intersectLines, intersectCircles.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Intersection point(s) of a line and a circle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
intersectLineEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 854
-- Function File: POINT = intersecLineEdge (LINE, EDGE)
Return intersection between a line and an edge.
Returns the intersection point of lines LINE and edge EDGE. LINE is
a 1x4 array containing parametric representation of the line (in
the form [x0 y0 dx dy], see 'createLine' for details). EDGE is a
1x4 array containing coordinates of first and second point (in the
form [x1 y1 x2 y2], see 'createEdge' for details).
In case of colinear line and edge, returns [Inf Inf]. If line does
not intersect edge, returns [NaN NaN].
If each input is [N*4] array, the result is a [N*2] array
containing intersections for each couple of edge and line. If one
of the input has N rows and the other 1 row, the result is a [N*2]
array.
See also: lines2d, edges2d, intersectEdges, intersectLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Return intersection between a line and an edge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
intersectLines
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1124
-- Function File: POINT = intersectLines (LINE1, LINE2)
-- Function File: POINT = intersectLines (LINE1, LINE2,EPS)
Return all intersection points of N lines in 2D.
Returns the intersection point of lines LINE1 and LINE2. LINE1 and
LINE2 are [1*4] arrays, containing parametric representation of
each line (in the form [x0 y0 dx dy], see 'createLine' for
details).
In case of colinear lines, returns [Inf Inf]. In case of parallel
but not colinear lines, returns [NaN NaN].
If each input is [N*4] array, the result is a [N*2] array
containing intersections of each couple of lines. If one of the
input has N rows and the other 1 row, the result is a [N*2] array.
A third input argument specifies the tolerance for detecting
parallel lines. Default is 1e-14.
Example
line1 = createLine([0 0], [10 10]);
line2 = createLine([0 10], [10 0]);
point = intersectLines(line1, line2)
point =
5 5
See also: lines2d, edges2d, intersectEdges, intersectLineEdge,
intersectLineCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Return all intersection points of N lines in 2D.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
isCounterClockwise
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1176
-- Function File: CCW = isCounterClockwise (P1, P2, P3)
-- Function File: CCW = isCounterClockwise (P1, P2, P3,TOL)
Compute relative orientation of 3 points
Computes the orientation of the 3 points. The returns is: +1 if
the path P1-> P2-> P3 turns Counter-Clockwise (i.e., the point P3
is located "on the left" of the line P1- P2) -1 if the path turns
Clockwise (i.e., the point P3 lies "on the right" of the line P1-
P2) 0 if the point P3 is located on the line segment [ P1 P2].
This function can be used in more complicated algorithms: detection
of line segment intersections, convex hulls, point in triangle...
CCW = isCounterClockwise( P1, P2, P3, EPS); Specifies the threshold
used for detecting colinearity of the 3 points. Default value is
1e-12 (absolute).
Example
isCounterClockwise([0 0], [10 0], [10 10])
ans =
1
isCounterClockwise([0 0], [0 10], [10 10])
ans =
-1
isCounterClockwise([0 0], [10 0], [5 0])
ans =
0
See also: points2d, isPointOnLine, isPointInTriangle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Compute relative orientation of 3 points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
isLeftOriented
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 338
-- Function File: B = isLeftOriented (POINT, LINE)
Test if a point is on the left side of a line
B = isLeftOriented(POINT, LINE); Returns TRUE if the point lies on
the left side of the line with respect to the line direction.
See also: lines2d, points2d, isCounterClockwise, isPointOnLine,
distancePointLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Test if a point is on the left side of a line
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
isParallel
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 754
-- Function File: B = isParallel (V1, V2)
-- Function File: B = isParallel (V1, V2,TOL)
Check parallelism of two vectors
V1 and V2 are 2 row vectors of length Nd, Nd being the dimension,
returns 'true' if the vectors are parallel, and 'false' otherwise.
Also works when V1 and V2 are two [NxNd] arrays with same number of
rows. In this case, return a [Nx1] array containing 'true' at the
positions of parallel vectors.
TOL specifies the accuracy of numerical computation. Default value
is 1e-14.
Example
isParallel([1 2], [2 4])
ans =
1
isParallel([1 2], [1 3])
ans =
0
See also: vectors2d, isPerpendicular, lines2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Check parallelism of two vectors
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
isPerpendicular
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 788
-- Function File: B = isPerpendicular (V1, V2)
-- Function File: B = isPerpendicula (V1, V2,TOL)
heck orthogonality of two vectors.
V1 and V2 are 2 row vectors of length Nd, Nd being the dimension,
returns 'true' if the vectors are perpendicular, and 'false'
otherwise.
Also works when V1 and V2 are two [NxNd] arrays with same number of
rows. In this case, return a [Nx1] array containing 'true' at the
positions of parallel vectors.
TOL specifies the accuracy of numerical computation. Default value
is 1e-14.
Example
isPerpendicular([1 2 0], [0 0 2])
ans =
1
isPerpendicular([1 2 1], [1 3 2])
ans =
0
See also: vectors2d, isParallel, lines2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
heck orthogonality of two vectors.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
isPointInCircle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 562
-- Function File: B = isPointInCircle (POINT, CIRCLE)
Test if a point is located inside a given circle
B = isPointInCircle(POINT, CIRCLE) Returns true if point is located
inside the circle, i.e. if distance to circle center is lower than
the circle radius.
B = isPointInCircle(POINT, CIRCLE, TOL) Specifies the tolerance
value
Example: isPointInCircle([1 0], [0 0 1]) isPointInCircle([0 0], [0
0 1]) returns true, whereas isPointInCircle([1 1], [0 0 1]) return
false
See also: circles2d, isPointOnCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Test if a point is located inside a given circle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
isPointInEllipse
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 560
-- Function File: B = isPointInellipse (POINT, ELLIPSE)
Check if a point is located inside a given ellipse
B = isPointInEllipse(POINT, ELLIPSE) Returns true if point is
located inside the given ellipse.
B = isPointInEllipse(POINT, ELLIPSE, TOL) Specifies the tolerance
value
Example: isPointInEllipse([1 0], [0 0 2 1 0]) ans = 1
isPointInEllipse([0 0], [0 0 2 1 0]) ans = 1 isPointInEllipse([1
1], [0 0 2 1 0]) ans = 0 isPointInEllipse([1 1], [0 0 2 1 30]) ans
= 1
See also: ellipses2d, isPointInCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Check if a point is located inside a given ellipse
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
isPointOnCircle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 535
-- Function File: B = isPointOnCircle (POINT, CIRCLE)
Test if a point is located on a given circle.
B = isPointOnCircle(POINT, CIRCLE) return true if point is located
on the circle, i.e. if the distance to the circle center equals
the radius up to an epsilon value.
B = isPointOnCircle(POINT, CIRCLE, TOL) Specifies the tolerance
value.
Example: isPointOnCircle([1 0], [0 0 1]) returns true, whereas
isPointOnCircle([1 1], [0 0 1]) return false
See also: circles2d, isPointInCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Test if a point is located on a given circle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
isPointOnEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1069
-- Function File: B = isPointOnEdge (POINT, EDGE)
-- Function File: B = isPointOnEdge (POINT, EDGE, TOL)
-- Function File: B = isPointOnEdge (POINT, EDGEARRAY)
-- Function File: B = isPointOnEdge (POINTARRAY, EDGEARRAY)
Test if a point belongs to an edge.
with POINT being [xp yp], and EDGE being [x1 y1 x2 y2], returns
TRUE if the point is located on the edge, and FALSE otherwise.
Specify an optilonal tolerance value TOL. The tolerance is given
as a fraction of the norm of the edge direction vector. Default is
1e-14.
When one of the inputs has several rows, return the result of the
test for each element of the array tested against the single
parameter.
When both POINTARRAY and EDGEARRAY have the same number of rows,
returns a column vector with the same number of rows. When the
number of rows are different and both greater than 1, returns a
Np-by-Ne matrix of booleans, containing the result for each couple
of point and edge.
See also: edges2d, points2d, isPointOnLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Test if a point belongs to an edge.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
isPointOnLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 467
-- Function File: B = isPointOnLine (POINT, LINE)
Test if a point belongs to a line
B = isPointOnLine(POINT, LINE) with POINT being [xp yp], and LINE
being [x0 y0 dx dy]. Returns 1 if point lies on the line, 0
otherwise.
If POINT is an N*2 array of points, B is a N*1 array of booleans.
If LINE is a N*4 array of line, B is a 1*N array of booleans.
See also: lines2d, points2d, isPointOnEdge, isPointOnRay,
angle3Points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Test if a point belongs to a line
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
isPointOnRay
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 387
-- Function File: B = isPointOnRay (POINT, RAY)
-- Function File: B = isPointOnRay (POINT, RAY, TOL)
Test if a point belongs to a ray
B = isPointOnRay(POINT, RAY); Returns 'true' if point POINT belongs
to the ray RAY. POINT is given by [x y] and RAY by [x0 y0 dx dy].
TOL gives the tolerance for the calculations.
See also: rays2d, points2d, isPointOnLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Test if a point belongs to a ray
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
lineAngle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 517
-- Function File: THETA = lineAngle(varargin)
Computes angle between two straight lines
A = lineAngle(LINE); Returns the angle between horizontal,
right-axis and the given line. Angle is fiven in radians, between 0
and 2*pi, in counter-clockwise direction.
A = lineAngle(LINE1, LINE2); Returns the directed angle between the
two lines. Angle is given in radians between 0 and 2*pi, in
counter-clockwise direction.
See also: lines2d, angles2d, createLine, normalizeAngle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Computes angle between two straight lines
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
linePosition
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 875
-- Function File: POS = linePosition (POINT, LINE)
Position of a point on a line.
Computes position of point POINT on the line LINE, relative to
origin point and direction vector of the line. LINE has the form
[x0 y0 dx dy], POINT has the form [x y], and is assumed to belong
to line.
If LINE is an array of NL lines, return NL positions, corresponding
to each line.
If POINT is an array of NP points, return NP positions,
corresponding to each point.
If POINT is an array of NP points and LINES is an array of NL
lines, return an array of [NP NL] position, corresponding to each
couple point-line.
Example
line = createLine([10 30], [30 90]);
linePosition([20 60], line)
ans =
.5
See also: lines2d, createLine, projPointOnLine, isPointOnLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Position of a point on a line.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
lines2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 962
-- Function File: lines2d ()
Description of functions operating on planar lines.
The term 'line' refers to a planar straight line, which is an
unbounded curve. Line segments defined between 2 points, which are
bounded, are called 'edge', and are presented in file 'edges2d'.
A straight line is defined by a point (its origin), and a vector
(its direction). The different parameters are bundled into a row
vector: LINE = [x0 y0 dx dy];
A line contains all points (x,y) such that: x = x0 + t*dx y = y0 +
t*dy; for all t between -infinity and +infinity.
See also: points2d, vectors2d, edges2d, rays2d createLine,
cartesianLine, medianLine, edgeToLine orthogonalLine, parallelLine,
bisector, radicalAxis lineAngle, linePosition, projPointOnLine
isPointOnLine, distancePointLine, isLeftOriented intersectLines,
intersectLineEdge, clipLine invertLine, transformLine, drawLine
lineFit.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Description of functions operating on planar lines.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
medianLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1272
-- Function File: LINE = medianLine (P1, P2)
-- Function File: LINE = medianLine (PTS)
-- Function File: LINE = medianLine (EDGE)
Create a median line between two points.
Create the median line of points P1 and P2, that is the line
containing all points located at equal distance of P1 and P2.
Creates the median line of 2 points, given as a 2*2 array PTS.
Array has the form: [ [ x1 y1 ] ; [ x2 y2 ] ]
Creates the median of the EDGE. EDGE is a 1*4 array, containing
[X1 Y1] coordinates of first point, and [X2 Y2], the coordinates of
the second point.
Example
# Draw the median line of two points
P1 = [10 20];
P2 = [30 50];
med = medianLine(P1, P2);
figure; axis square; axis([0 100 0 100]);
drawEdge([P1 P2], 'linewidth', 2, 'color', 'k');
drawLine(med)
# Draw the median line of an edge
P1 = [50 60];
P2 = [80 30];
edge = createEdge(P1, P2);
figure; axis square; axis([0 100 0 100]);
drawEdge(edge, 'linewidth', 2)
med = medianLine(edge);
drawLine(med)
See also: lines2d, createLine, orthogonalLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Create a median line between two points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
mergeBoxes
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 316
-- Function File: BOX = mergeBoxes (BOX1, BOX2)
Merge two boxes, by computing their greatest extent.
Example
box1 = [5 20 5 30];
box2 = [0 15 0 15];
mergeBoxes(box1, box2)
ans =
0 20 0 30
See also: boxes2d, drawBox, intersectBoxes.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Merge two boxes, by computing their greatest extent.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
midPoint
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 858
-- Function File: MID = midPoint (P1, P2)
-- Function File: MID = midPoint (EDGE)
-- Function File: [MIDX, MIDY] = midPoint (EDGE)
Middle point of two points or of an edge
Computes the middle point of the two points P1 and P2.
If an edge is given, computes the middle point of the edge given by
EDGE. EDGE has the format: [X1 Y1 X2 Y2], and MID has the format
[XMID YMID], with XMID = (X1+X2)/2, and YMID = (Y1+Y2)/2.
If two output arguments are given, it returns the result as two
separate variables or arrays.
Works also when EDGE is a N-by-4 array, in this case the result is
a N-by-2 array containing the midpoint of each edge.
Example
p1 = [10 20];
p2 = [30 40];
midPoint([p1 p2])
ans =
20 30
See also: edges2d, points2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Middle point of two points or of an edge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
minDistancePoints
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2383
-- Function File: DIST = minDistancePoints (PTS)
-- Function File: DIST = minDistancePoints (PTS1,PTS2)
-- Function File: DIST = minDistancePoints (...,NORM)
-- Function File: [DIST I J] = minDistancePoints (PTS1, PTS2, ...)
-- Function File: [DIST J] = minDistancePoints (PTS1, PTS2, ...)
Minimal distance between several points.
Returns the minimum distance between all couple of points in PTS.
PTS is an array of [NxND] values, N being the number of points and
ND the dimension of the points.
Computes for each point in PTS1 the minimal distance to every point
of PTS2. PTS1 and PTS2 are [NxD] arrays, where N is the number of
points, and D is the dimension. Dimension must be the same for
both arrays, but number of points can be different. The result is
an array the same length as PTS1.
When NORM is provided, it uses a user-specified norm. NORM=2 means
euclidean norm (the default), NORM=1 is the Manhattan (or
"taxi-driver") distance. Increasing NORM growing up reduces the
minimal distance, with a limit to the biggest coordinate difference
among dimensions.
Returns indices I and J of the 2 points which are the closest.
DIST verifies relation: DIST = distancePoints(PTS(I,:), PTS(J,:));
If only 2 output arguments are given, it returns the indices of
points which are the closest. J has the same size as DIST. for
each I It verifies the relation : DIST(I) =
distancePoints(PTS1(I,:), PTS2(J,:));
Examples:
# minimal distance between random planar points
points = rand(20,2)*100;
minDist = minDistancePoints(points);
# minimal distance between random space points
points = rand(30,3)*100;
[minDist ind1 ind2] = minDistancePoints(points);
minDist
distancePoints(points(ind1, :), points(ind2, :))
# results should be the same
# minimal distance between 2 sets of points
points1 = rand(30,2)*100;
points2 = rand(30,2)*100;
[minDists inds] = minDistancePoints(points1, points2);
minDists(10)
distancePoints(points1(10, :), points2(inds(10), :))
# results should be the same
See also: points2d, distancePoints.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Minimal distance between several points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
normalizeAngle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 857
-- Function File: ALPHA2 = normalizeAngle (ALPHA)
-- Function File: ALPHA2 = normalizeAngle (ALPHA, CENTER)
Normalize an angle value within a 2*PI interval
ALPHA2 = normalizeAngle(ALPHA); ALPHA2 is the same as ALPHA modulo
2*PI and is positive.
ALPHA2 = normalizeAngle(ALPHA, CENTER); Specifies the center of the
angle interval. If CENTER==0, the interval is [-pi ; +pi] If
CENTER==PI, the interval is [0 ; 2*pi] (default).
Example: # normalization between 0 and 2*pi (default)
normalizeAngle(5*pi) ans = 3.1416
# normalization between -pi and +pi normalizeAngle(7*pi/2, 0) ans =
-1.5708
References Follows the same convention as apache commons library,
see:
http://commons.apache.org/math/api-2.2/org/apache/commons/math/util/MathUtils.html##
See also: vectorAngle, lineAngle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Normalize an angle value within a 2*PI interval
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
normalizeVector
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 502
-- Function File: VN = normalizeVector (V)
Normalize a vector to have norm equal to 1
Returns the normalization of vector V, such that ||V|| = 1. V can
be either a row or a column vector.
When V is a MxN array, normalization is performed for each row of
the array.
Example:
vn = normalizeVector([3 4])
vn =
0.6000 0.8000
vectorNorm(vn)
ans =
1
See also: vectors2d, vectorNorm.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Normalize a vector to have norm equal to 1
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
orthogonalLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 342
-- Function File: PERP = orthogonalLine (LINE, POINT)
Create a line orthogonal to another one.
Returns the line orthogonal to the line LINE and going through the
point given by POINT. Directed angle from LINE to PERP is pi/2.
LINE is given as [x0 y0 dx dy] and POINT is [xp yp].
See also: lines2d, parallelLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Create a line orthogonal to another one.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
parallelLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 557
-- Function File: RES = parallelLine (LINE, POINT)
-- Function File: RES = parallelLine (LINE, DIST)
Create a line parallel to another one.
Returns the line with same direction vector than LINE and going
through the point given by POINT. LINE is given as [x0 y0 dx dy]
and POINT is [xp yp].
Uses relative distance to specify position. The new line will be
located at distance DIST, counted positive in the right side of
LINE and negative in the left side.
See also: lines2d, orthogonalLine, distancePointLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Create a line parallel to another one.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
pointOnLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 443
-- Function File: POINT = pointOnLine (LINE, D)
Create a point on a line at a given position on the line.
Creates the point belonging to the line LINE, and located at the
distance D from the line origin. LINE has the form [x0 y0 dx dy].
LINE and D should have the same number N of rows. The result will
have N rows and 2 column (x and y positions).
See also: lines2d, points2d, onLine, onLine, linePosition.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Create a point on a line at a given position on the line.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
points2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 580
-- Function File: points2d ()
Description of functions operating on points.
A point is defined by its two cartesian coordinate, put into a row
vector of 2 elements: P = [x y];
Several points are stores in a matrix with two columns, one for the
x-coordinate, one for the y-coordinate. PTS = [x1 y1 ; x2 y2 ; x3
y3];
Example P = [5 6];
See also: centroid, midPoint, polarPoint, pointOnLine
isCounterClockwise, angle2Points, angle3Points, angleSort
distancePoints, minDistancePoints transformPoint, clipPoints,
drawPoint.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Description of functions operating on points.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
polarPoint
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 747
-- Function File: POINT = polarPoint (RHO, THETA)
-- Function File: POINT = polarPoint (THETA)
-- Function File: POINT = polarPoint (POINT, RHO, THETA)
-- Function File: POINT = polarPoint (X0, Y0, RHO, THETA)
Create a point from polar coordinates (rho + theta)
Creates a point using polar coordinate. THETA is angle with
horizontal (counted counter-clockwise, and in radians), and RHO is
the distance to origin. If only angle is given radius RHO is
assumed to be 1.
If a point is given, adds the coordinate of the point to the
coordinate of the specified point. For example, creating a point
with : P = polarPoint([10 20], 30, pi/2); will give a result of [40
20].
See also: points2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Create a point from polar coordinates (rho + theta)
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
projPointOnLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 559
-- Function File: POINT = projPointOnLine (PT1, LINE)
Project of a point orthogonally onto a line
Computes the (orthogonal) projection of point PT1 onto the line
LINE.
Function works also for multiple points and lines. In this case,
it returns multiple points. Point PT1 is a [N*2] array, and LINE is
a [N*4] array (see createLine for details). Result POINT is a
[N*2] array, containing coordinates of orthogonal projections of
PT1 onto lines LINE.
See also: lines2d, points2d, isPointOnLine, linePosition.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Project of a point orthogonally onto a line
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
rad2deg
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 259
-- Function File: DEG = rad2deg( RAD)
Convert angle from radians to degrees
Usage: R = rad2deg(D) convert an angle in radians to angle in
degrees
Example: rad2deg(pi) ans = 180 rad2deg(pi/3) ans = 60
See also: angles2d, deg2rad.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Convert angle from radians to degrees
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
radicalAxis
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 509
-- Function File: LINE = radicalAxis (CIRCLE1, CIRCLE2)
Compute the radical axis (or radical line) of 2 circles
L = radicalAxis(C1, C2) Computes the radical axis of 2 circles.
Example C1 = [10 10 5]; C2 = [60 50 30]; L = radicalAxis(C1, C2);
hold on; axis equal;axis([0 100 0 100]);
drawCircle(C1);drawCircle(C2);drawLine(L);
Ref: http://mathworld.wolfram.com/RadicalLine.html
http://en.wikipedia.org/wiki/Radical_axis
See also: lines2d, circles2d, createCircle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Compute the radical axis (or radical line) of 2 circles
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
randomPointInBox
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 661
-- Function File: POINTS = randomPointInBox (BOX)
-- Function File: POINTS = randomPointInBox (BOX, N)
Generate random points within a box.
Generate a random point within the box BOX. The result is a 1-by-2
row vector. If N is given, generates N points. The result is a
N-by-2 array.
Example
# draw points within a box
box = [10 80 20 60];
pts = randomPointInBox(box, 500);
figure(1); clf; hold on;
drawBox(box);
drawPoint(pts, '.');
axis('equal');
axis([0 100 0 100]);
See also: edges2d, boxes2d, clipLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Generate random points within a box.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
rays2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 711
-- Function File: rays2d ()
Description of functions operating on planar rays
A ray is defined by a point (its origin), and a vector (its
direction). The different parameters are bundled into a row
vector: 'RAY = [x0 y0 dx dy];'
The ray contains all the points (x,y) such that: x = x0 + t*dx y =
y0 + t*dy; for all t>0
Contrary to a (straight) line, the points located before the origin
do not belong to the ray. However, as rays and lines have the same
representation, some functions working on lines are also working on
rays (like 'transformLine').
See also: points2d, vectors2d, lines2d, createRay, bisector,
isPointOnRay, clipRay, drawRay.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Description of functions operating on planar rays
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
reverseEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 309
-- Function File: RES = reverseEdge (EDGE)
Intervert the source and target vertices of edge
REV = reverseEdge(EDGE); Returns the opposite edge of EDGE. EDGE
has the format [X1 Y1 X2 Y2]. The resulting edge REV has value [X2
Y2 X1 Y1];
See also: edges2d, createEdge, reverseLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Intervert the source and target vertices of edge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
reverseLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 312
-- Function File: LINE = reverseLine (LINE)
Return same line but with opposite orientation
INVLINE = reverseLine(LINE); Returns the opposite line of LINE.
LINE has the format [x0 y0 dx dy], then INVLINE will have following
parameters: [x0 y0 -dx -dy].
See also: lines2d, createLine.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Return same line but with opposite orientation
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
rotateVector
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 303
-- Function File: VR = rotateVector (V, THETA)
Rotate a vector by a given angle
Rotate the vector V by an angle THETA, given in radians.
Example
rotateVector([1 0], pi/2)
ans =
0 1
See also: vectors2d, transformVector, createRotation.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Rotate a vector by a given angle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
squareGrid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 480
-- Function File: PTS = squaregrid (BOUNDS, ORIGIN, SIZE)
Generate equally spaces points in plane.
usage PTS = squareGrid(BOUNDS, ORIGIN, SIZE) generate points, lying
in the window defined by BOUNDS (=[xmin ymin xmax ymax]), starting
from origin with a constant step equal to size.
Example PTS = squareGrid([0 0 10 10], [3 3], [4 2]) will return
points : [3 1;7 1;3 3;7 3;3 5;7 5;3 7;7 7;3 9;7 9];
TODO: add possibility to use rotated grid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Generate equally spaces points in plane.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
transformEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 535
-- Function File: EDGE2 = transformEdge (EDGE1, T)
Transform an edge with an affine transform.
Where EDGE1 has the form [x1 y1 x2 y1], and T is a transformation
matrix, return the edge transformed with affine transform T.
Format of TRANS can be one of : [a b] , [a b c] , or [a b c] [d e]
[d e f] [d e f] [0 0 1]
Also works when EDGE1 is a [Nx4] array of double. In this case,
EDGE2 has the same size as EDGE1.
See also: edges2d, transforms2d, transformPoint, translation,
rotation.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform an edge with an affine transform.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
transformLine
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 503
-- Function File: LINE2 = transformLine (LINE1, T)
Transform a line with an affine transform.
Returns the line LINE1 transformed with affine transform T. LINE1
has the form [x0 y0 dx dy], and T is a transformation matrix.
Format of T can be one of : [a b] , [a b c] , or [a b c] [d e] [d e
f] [d e f] [0 0 1]
Also works when LINE1 is a [Nx4] array of double. In this case,
LINE2 has the same size as LINE1.
See also: lines2d, transforms2d, transformPoint.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Transform a line with an affine transform.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
transformPoint
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 799
-- Function File: PT2 = transformPoint (PT1, TRANS)
-- Function File: [PX2 PY2]= transformPoint (PX1, PY1, TRANS)
Transform a point with an affine transform.
where PT1 has the form [xp yp], and TRANS is a [2x2], [2x3] or
[3x3] matrix, returns the point transformed with affine transform
TRANS.
Format of TRANS can be one of : [a b] , [a b c] , or [a b c] [d e]
[d e f] [d e f] [0 0 1]
Also works when PT1 is a [Nx2] array of double. In this case, PT2
has the same size as PT1.
Also works when PX1 and PY1 are arrays the same size. The function
transform each couple of (PX1, PY1), and return the result in (PX2,
PY2), which is the same size as (PX1 PY1).
See also: points2d, transforms2d, createTranslation,
createRotation.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform a point with an affine transform.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
transformVector
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 733
-- Function File: V2 = transformVector (V, T)
-- Function File: [X2 Y2] = transformVector (X,Y, T)
Transform a vector with an affine transform
V has the form [xv yv], and T is a [2x2], [2x3] or [3x3] matrix,
returns the vector transformed with affine transform T.
Format of T can be one of :
[a b] , [a b c] , or [a b c] [d e] [d e f] [d e f] [0 0 1]
Also works when V is a [Nx2] array of double. In this case, V2 has
the same size as V.
Also works when X and Y are arrays the same size. The function
transform each couple of (X, Y), and return the result in (X2, Y2),
which is the same size as (X, Y).
See also: vectors2d, transforms2d, rotateVector, transformPoint.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform a vector with an affine transform
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
transforms2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 674
-- Function File: transforms2d ()
Description of functions operating on transforms
By 'transform' we mean an affine transform. A planar affine
transform can be represented by a 3x3 matrix.
Example
# create a translation by the vector [10 20]:
T = createTranslation([10 20])
T =
1 0 10
0 1 20
0 0 1
See also: createTranslation, createRotation, createScaling,
createBasisTransform, createHomothecy, createLineReflection,
fitAffineTransform2d, transformPoint, transformVector,
transformLine, transformEdge, rotateVector.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Description of functions operating on transforms
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
triangleGrid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 464
-- Function File: PTS = triangleGrid (BOUNDS, ORIGIN, SIZE)
Generate triangular grid of points in the plane.
usage PTS = triangleGrid(BOUNDS, ORIGIN, SIZE) generate points,
lying in the window defined by BOUNDS, given in form [xmin ymin
xmax ymax], starting from origin with a constant step equal to
size. SIZE is constant and is equals to the length of the sides of
each triangles.
TODO: add possibility to use rotated grid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Generate triangular grid of points in the plane.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
vectorAngle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 891
-- Function File: ALPHA = vectorAngle (V1)
Angle of a vector, or between 2 vectors
A = vectorAngle(V); Returns angle between Ox axis and vector
direction, in Counter clockwise orientation. The result is
normalised between 0 and 2*PI.
A = vectorAngle(V1, V2); Returns the angle from vector V1 to vector
V2, in counter-clockwise order, and in radians.
A = vectorAngle(..., 'cutAngle', CUTANGLE); A = vectorAngle(...,
CUTANGLE); # (deprecated syntax) Specifies convention for angle
interval. CUTANGLE is the center of the 2*PI interval containing
the result. See <a href="matlab:doc
('normalizeAngle')">normalizeAngle</a> for details.
Example: rad2deg(vectorAngle([2 2])) ans = 45
rad2deg(vectorAngle([1 sqrt(3)])) ans = 60 rad2deg(vectorAngle([0
-1])) ans = 270
See also: vectors2d, angles2d, normalizeAngle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Angle of a vector, or between 2 vectors
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
vectorNorm
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 751
-- Function File: NM = vectorNorm (V)
-- Function File: NM = vectorNorm (V,N)
Compute norm of a vector, or of a set of vectors
Without extra arguments, returns the euclidean norm of vector V.
Optional argument N specifies the norm to use. N can be any value
greater than 0.
'N=1'
City lock norm.
'N=2'
Euclidean norm.
'N=inf'
Compute max coord.
When V is a MxN array, compute norm for each vector of the array.
Vector are given as rows. Result is then a Mx1 array.
Example
n1 = vectorNorm([3 4])
n1 =
5
n2 = vectorNorm([1, 10], inf)
n2 =
10
See also: vectors2d, vectorAngle.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Compute norm of a vector, or of a set of vectors
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
vectors2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 493
-- Function File: vectors2d ()
Description of functions operating on plane vectors
A vector is defined by its two cartesian coordinates, put into a
row vector of 2 elements: 'V = [vx vy];'
Several vectors are stored in a matrix with two columns, one for
the x-coordinate, one for the y-coordinate. 'VS = [vx1 vy1 ; vx2
vy2 ; vx3 vy3];'
See also: vectorNorm, vectorAngle, isPerpendicular, isParallel,
normalizeVector, transformVector, rotateVector.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Description of functions operating on plane vectors
|