/usr/share/octave/packages/geometry-1.7.0/geom3d/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 | # Created by Octave 3.8.0, Tue Feb 25 00:01:33 2014 UTC <root@aatxe>
# name: cache
# type: cell
# rows: 3
# columns: 57
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
anglePoints3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 530
-- Function File: ALPHA = anglePoints3d (P1, P2)
-- Function File: ALPHA = anglePoints3d (P1, P2,P3)
-- Function File: ALPHA = anglePoints3d (PTS)
Compute angle between three 3D points
ALPHA = anglePoints3d(P1, P2) Computes angle (P1, O, P2), in
radians, between 0 and PI.
ALPHA = anglePoints3d(P1, P2, P3) Computes angle (P1, P2, P3), in
radians, between 0 and PI.
ALPHA = anglePoints3d(PTS) PTS is a 3x3 or 2x3 array containing
coordinate of points.
See also: points3d, angles3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Compute angle between three 3D points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
angleSort3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 981
-- Function File: PTS2 = angleSort3d (PTS)
-- Function File: PTS2 = angleSort3d (PTS,PTS0)
-- Function File: PTS2 = angleSort3d (PTS,PTS0,PTS1)
-- Function File: [PTS2 I]= angleSort3d (...)
Sort 3D coplanar points according to their angles in plane
PTS2 = angleSort3d(PTS); Considers all points are located on the
same plane, and sort them according to the angle on plane. PTS is
a [Nx2] array. Note that the result depend on plane orientation:
points can be in reverse order compared to expected. The reference
plane is computed besed on the 3 first points.
PTS2 = angleSort3d(PTS, PTS0); Computes angles between each point
of PTS and PT0. By default, uses centroid of points.
PTS2 = angleSort3d(PTS, PTS0, PTS1); Specifies the point which will
be used as a start.
[PTS2, I] = angleSort3d(...); Also return in I the indices of PTS,
such that PTS2 = PTS(I, :);
See also: points3d, angles3d, angleSort.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Sort 3D coplanar points according to their angles in plane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
angles3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1461
-- Function File: angles3d ()
ANGLES3D Conventions for manipulating angles in 3D
Contrary to the plane, there are no oriented angles in 3D. Angles
between lines or between planes are comprised between 0 and PI.
Spherical angles Spherical angles are defined by 2 angles: * THETA,
the colatitude, representing angle with Oz axis (between 0 and PI)
* PHI, the azimut, representing angle with Ox axis of horizontal
projection of the direction (between 0 and 2*PI)
Spherical coordinates can be represented by THETA, PHI, and the
distance RHO to the origin.
Euler angles Some functions for creating rotations use Euler
angles. They follow the ZYX convention in the global reference
system, that is eqivalent to the XYZ convention ine a local
reference system. Euler angles are given by a triplet of angles
[PHI THETA PSI] that represents the succession of 3 rotations: *
rotation around X by angle PSI ("roll") * rotation around Y by
angle THETA ("pitch") * rotation around Z by angle PHI ("yaw")
In this library, euler angles are given in degrees. The functions
that use euler angles use the keyword 'Euler' in their name.
See also: cart2sph2, sph2cart2, cart2sph2d, sph2cart2d
anglePoints3d, angleSort3d, sphericalAngle, randomAngle3d
dihedralAngle, polygon3dNormalAngle, eulerAnglesToRotation3d
rotation3dAxisAndAngle, rotation3dToEulerAngles.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
ANGLES3D Conventions for manipulating angles in 3D
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
boundingBox3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 540
-- Function File: BOX = boundingBox3d (POINTS)
Bounding box of a set of 3D points
Returns the bounding box of the set of points POINTS. POINTS is a
N-by-3 array containing points coordinates. The result BOX is a
1-by-6 array, containing: [XMIN XMAX YMIN YMAX ZMIN ZMAX]
Example
# Draw bounding box of a cubeoctehedron [v e f] =
createCubeOctahedron; box3d = boundingBox3d(v); figure; hold on;
drawMesh(v, f); drawBox3d(box3d); axis([-2 2 -2 2 -2 2]); view(3)
See also: boxes3d, drawBox3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Bounding box of a set of 3D points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
box3dVolume
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 391
-- Function File: V = box3dVolume (BOX)
Volume of a 3-dimensional box
A box is represented as a set of limits in each direction: BOX =
[XMIN XMAX YMIN YMAX ZMIN ZMAX].
Example
[n e f] = createCubeOctahedron;
box = boundingBox3d(n);
vol = box3dVolume(box)
vol =
8
See also: boxes3d, boundingBox3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Volume of a 3-dimensional box
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
boxes3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 455
-- Function File: boxes3d ()
BOXES3D Description of functions operating on 3D boxes
A box defined by its coordinate extents: BOX = [XMIN XMAX YMIN YMAX
ZMIN ZMAX].
Example # Draw a polyhedron together with its bounding box [n e f]=
createIcosahedron; drawPolyhedron(n, f); hold on;
drawBox3d(point3dBounds(n))
See also: point3dBounds, box3dVolume, drawBox3d intersectBoxes3d,
mergeBoxes3d, randomPointInBox3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
BOXES3D Description of functions operating on 3D boxes
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
cart2cyl
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 761
-- Function File: CYL = cart2cyl (POINT)
-- Function File: CYL = cart2cyl (X, Y, Z)
Convert cartesian to cylindrical coordinates
CYL = cart2cyl(POINT) convert the 3D cartesian coordinates of
points POINT (given by [X Y Z] where X, Y, Z have the same size)
into cylindrical coordinates CYL, given by [THETA R Z]. THETA is
the arctangent of the ratio Y/X (between 0 and 2*PI) R can be
computed using sqrt(X^2+Y^2) Z keeps the same value. The size of
THETA, and R is the same as the size of X, Y and Z.
CYL = cart2cyl(X, Y, Z) provides coordinates as 3 different
parameters
Example
cart2cyl([-1 0 2])
gives : 4.7124 1.0000 2.0000
See also: agles3d, cart2pol, cart2sph2.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Convert cartesian to cylindrical coordinates
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
cart2sph2
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 858
-- Function File: [THETA PHI RHO] = cart2sph2([ X Y Z])
-- Function File: [THETA PHI RHO] = cart2sph2( X, Y, Z)
Convert cartesian coordinates to spherical coordinates
The following convention is used: THETA is the colatitude, in
radians, 0 for north pole, +pi for south pole, pi/2 for points with
z=0. PHI is the azimuth, in radians, defined as matlab cart2sph:
angle from Ox axis, counted counter-clockwise. RHO is the distance
of the point to the origin. Discussion on choice for convention
can be found at:
<http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf>
Example:
cart2sph2([1 0 0]) returns [pi/2 0 1];
cart2sph2([1 1 0]) returns [pi/2 pi/4 sqrt(2)];
cart2sph2([0 0 1]) returns [0 0 1];
See also: angles3d, sph2cart2, cart2sph, cart2sph2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Convert cartesian coordinates to spherical coordinates
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
cart2sph2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 960
-- Function File: [THETA PHI RHO] = cart2sph2d (COORD)
-- Function File: [...] = cart2sph2d (X,Y,Z)
Convert cartesian coordinates to spherical coordinates in degrees
The following convention is used: THETA is the colatitude, in
degrees, 0 for north pole, 180 degrees for south pole, 90 degrees
for points with z=0. PHI is the azimuth, in degrees, defined as
matlab cart2sph: angle from Ox axis, counted counter-clockwise.
RHO is the distance of the point to the origin. Discussion on
choice for convention can be found at:
<http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf>
Example:
cart2sph2d([1 0 0])
ans =
90 0 1
cart2sph2d([1 1 0])
ans =
90 45 1.4142
cart2sph2d([0 0 1])
ans =
0 0 1
See also: angles3d, sph2cart2d, cart2sph, cart2sph2.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Convert cartesian coordinates to spherical coordinates in degrees
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
circle3dOrigin
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 327
-- Function File: P = circle3dOrigin([ XC YC ZC R THETA PHI])
-- Function File: P = circle3dOrigin([ XC YC ZC R THETA PHI PSI])
Return the first point of a 3D circle
Returns the origin point of the circle, i.e. the first point used
for drawing circle.
See also: circles3d, points3d, circle3dPosition.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Return the first point of a 3D circle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
circle3dPoint
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 661
-- Function File: POINT = circle3dPoint (CIRCLE,POS)
Coordinates of a point on a 3D circle from its position
Example
circle = [0 0 0 1 45 45 0];
# Draw some points on a 3D circle
figure; hold on;
# origin point
pos1 = 0;
drawPoint3d(circle3dPoint(circle, pos1), 'ro')
# few points regularly spaced
for i = 10:10:40
drawPoint3d(circle3dPoint(circle, i))
end
# Draw point opposite to origin
drawPoint3d(circle3dPoint(circle, 180), 'k*')
See also: circles3d, circle3dPosition.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Coordinates of a point on a 3D circle from its position
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
circle3dPosition
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 415
-- Function File: POS = circle3dPosition( POINT, CIRCLE)
Return the angular position of a point on a 3D circle
Returns angular position of point on the circle, in degrees,
between 0 and 360. with POINT: [xp yp zp] and CIRCLE: [X0 Y0 Z0 R
THETA PHI] or [X0 Y0 Z0 R THETA PHI PSI] (THETA being the
colatitude, and PHI the azimut)
See also: circles3d, circle3dOrigin, circle3dPoint.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Return the angular position of a point on a 3D circle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
circles3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 703
-- Function File: circles3d ()
CIRCLES3D Description of functions operating on 3D circles
Circles are represented by a center, a radius and a 3D angle
representing the normal of the plane containing the circle. C = [xc
yc zc R theta phi psi]. THETA is the colatitude of the normal, in
degrees, between 0 and 180 PHI is the azimut of the normal, in
degrees, between 0 and 360 PSI is the proper rotation of the circle
around the normal, between 0 and 360 degrees The parameter PSI is
used to locate a point on the 3D circle.
See also: circle3dOrigin, circle3dPosition, circle3dPoint,
intersectPlaneSphere drawCircle3d, drawCircleArc3d, drawEllipse3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
CIRCLES3D Description of functions operating on 3D circles
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
createPlane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1060
-- Function File: PLANE = createPlane (PTS)
-- Function File: PLANE = createPlane (P0, N)
-- Function File: PLANE = createPlane (P1, P2, P3)
Create a plane in parametrized form
PLANE = createPlane(PTS) The 3 points are packed into a single 3x3
array.
PLANE = createPlane(P0, N); Creates a plane from a point and from a
normal to the plane. The parameter N is given either as a 3D
vector (1-by-3 row vector), or as [THETA PHI], where THETA is the
colatitute (angle with the vertical axis) and PHI is angle with Ox
axis, counted counter-clockwise (both given in radians).
PLANE = createPlane(P1, P2, P3) creates a plane containing the 3
points
The created plane data has the following format: PLANE = [X0 Y0 Z0
DX1 DY1 DZ1 DX2 DY2 DZ2], with - (X0, Y0, Z0) is a point belonging
to the plane - (DX1, DY1, DZ1) is a first direction vector - (DX2,
DY2, DZ2) is a second direction vector The 2 direction vectors are
normalized and orthogonal.
See also: planes3d, medianPlane.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Create a plane in parametrized form
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createRotationOx
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 943
-- Function File: TRANS = createRotationOx (THETA)
-- Function File: TRANS = createRotationOx (ORIGIN,THETA)
-- Function File: TRANS = createRotationOx (X0,Y0,Z0,THETA)
Create the 4x4 matrix of a 3D rotation around x-axis
TRANS = createRotationOx(THETA); Returns the transform matrix
corresponding to a rotation by the angle THETA (in radians) around
the Ox axis. A rotation by an angle of PI/2 would transform the
vector [0 1 0] into the vector [0 0 1].
The returned matrix has the form: [1 0 0 0] [0 cos(THETA)
-sin(THETA) 0] [0 sin(THETA) cos(THETA) 0] [0 0 0 1]
TRANS = createRotationOx(ORIGIN, THETA); TRANS =
createRotationOx(X0, Y0, Z0, THETA); Also specifies origin of
rotation. The result is similar as performing translation(-X0,
-Y0, -Z0), rotation, and translation(X0, Y0, Z0).
See also: transforms3d, transformPoint3d, createRotationOy,
createRotationOz.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Create the 4x4 matrix of a 3D rotation around x-axis
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createRotationOy
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 943
-- Function File: TRANS = createRotationOy (THETA)
-- Function File: TRANS = createRotationOy (ORIGIN,THETA)
-- Function File: TRANS = createRotationOy (X0,Y0,Z0,THETA)
Create the 4x4 matrix of a 3D rotation around x-axis
TRANS = createRotationOy(THETA); Returns the transform matrix
corresponding to a rotation by the angle THETA (in radians) around
the Oy axis. A rotation by an angle of PI/2 would transform the
vector [0 1 0] into the vector [0 0 1].
The returned matrix has the form: [1 0 0 0] [0 cos(THETA)
-sin(THETA) 0] [0 sin(THETA) cos(THETA) 0] [0 0 0 1]
TRANS = createRotationOy(ORIGIN, THETA); TRANS =
createRotationOy(X0, Y0, Z0, THETA); Also specifies origin of
rotation. The result is similar as performing translation(-X0,
-Y0, -Z0), rotation, and translation(X0, Y0, Z0).
See also: transforms3d, transformPoint3d, createRotationOx,
createRotationOz.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Create the 4x4 matrix of a 3D rotation around x-axis
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createRotationOz
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 943
-- Function File: TRANS = createRotationOz (THETA)
-- Function File: TRANS = createRotationOz (ORIGIN,THETA)
-- Function File: TRANS = createRotationOz (X0,Y0,Z0,THETA)
Create the 4x4 matrix of a 3D rotation around x-axis
TRANS = createRotationOz(THETA); Returns the transform matrix
corresponding to a rotation by the angle THETA (in radians) around
the Oz axis. A rotation by an angle of PI/2 would transform the
vector [0 1 0] into the vector [0 0 1].
The returned matrix has the form: [1 0 0 0] [0 cos(THETA)
-sin(THETA) 0] [0 sin(THETA) cos(THETA) 0] [0 0 0 1]
TRANS = createRotationOz(ORIGIN, THETA); TRANS =
createRotationOz(X0, Y0, Z0, THETA); Also specifies origin of
rotation. The result is similar as performing translation(-X0,
-Y0, -Z0), rotation, and translation(X0, Y0, Z0).
See also: transforms3d, transformPoint3d, createRotationOx,
createRotationOy.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Create the 4x4 matrix of a 3D rotation around x-axis
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
createScaling3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 751
-- Function File: TRANS = createScaling3d (S)
-- Function File: TRANS = createScaling3d (SX, SY, SZ)
Create the 4x4 matrix of a 3D scaling
TRANS = createScaling3d(S); returns the scaling transform
corresponding to a scaling factor S in each direction. S can be a
scalar, or a 1x3 vector containing the scaling factor in each
direction.
TRANS = createScaling3d(SX, SY, SZ); returns the scaling transform
corresponding to a different scaling factor in each direction.
The returned matrix has the form :
[SX 0 0 0] [ 0 SY 0 0] [ 0 0 SZ 0] [ 0 0 0 0]
See also: transforms3d, transformPoint3d, transformVector3d,
createTranslation3d, createRotationOx, createRotationOy,
createRotationOz.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Create the 4x4 matrix of a 3D scaling
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
createTranslation3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 603
-- Function File: = createTranslation3d (DX, DY, DZ)
-- Function File: = createTranslation3d (VECT)
Create the 4x4 matrix of a 3D translation
usage: TRANS = createTranslation3d(DX, DY, DZ); return the
translation corresponding to DX and DY. The returned matrix has the
form : [1 0 0 DX] [0 1 0 DY] [0 0 1 DZ] [0 0 0 1]
TRANS = createTranslation3d(VECT); return the translation
corresponding to the given vector [x y z].
See also: transforms3d, transformPoint3d, transformVector3d,
createRotationOx, createRotationOy, createRotationOz,
createScaling3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Create the 4x4 matrix of a 3D translation
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
cyl2cart
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 682
-- Function File: CART = cyl2cart (CYL)
-- Function File: CART = cyl2cart (THETA,R,Z)
Convert cylindrical to cartesian coordinates
CART = cyl2cart(CYL) convert the 3D cylindrical coordinates of
points CYL (given by [THETA R Z] where THETA, R, and Z have the
same size) into cartesian coordinates CART, given by [X Y Z]. The
transforms is the following : X = R*cos(THETA); Y = R*sin(THETA); Z
remains inchanged.
CART = cyl2cart(THETA, R, Z) provides coordinates as 3 different
parameters
Example
cyl2cart([-1 0 2])
gives : 4.7124 1.0000 2.0000
See also: angles3d, cart2pol, cart2sph2, cart2cyl.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Convert cylindrical to cartesian coordinates
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
distancePointLine3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 493
-- Function File: D = distancePointLine3d (POINT, LINE)
Euclidean distance between 3D point and line
Returns the distance between point POINT and the line LINE, given
as: POINT : [x0 y0 z0] LINE : [x0 y0 z0 dx dy dz] D : (positive)
scalar
Run 'demo distancePointLine3d' to see examples.
References
http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
See also: lines3d, distancePointLine, distancePointEdge3d,
projPointOnLine3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Euclidean distance between 3D point and line
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
distancePoints
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 908
-- Function File: D = distancePoints( P1, P2)
-- Function File: D = distancePoints( P1, P2,NORM)
-- Function File: D = distancePoints (..., 'diag')
Compute euclidean distance between pairs of points in any dimension
Return distance D between points P1 and P2, given as [X Y Z ...
Wdim].
If P1 and P2 are two arrays of points, result is a N1-by-N2 array
containing distance between each point of P1 and each point of P2.
D = distancePoints(P1, P2, NORM) with NORM being 1, 2, or Inf,
corresponfing to the norm used. Default is 2 (euclidean norm). 1
correspond to manhattan (or taxi driver) distance and Inf to
maximum difference in each coordinate.
When 'diag' is given, computes only distances between 'P1(i,:)' and
'P2(i,:)'. In this case the numer of points in each array must be
the same.
See also: points3d, minDistancePoints.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
Compute euclidean distance between pairs of points in any dimension
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawAxis3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 506
-- Function File: drawAxis3d ()
-- Function File: drawAxis3d ( L,R)
Draw a coordinate system and an origin
Adds 3 cylinders to the current axis, corresponding to the
directions of the 3 basis vectors Ox, Oy and Oz. Ox vector is red,
Oy vector is green, and Oz vector is blue.
L specifies the length and R the radius of the cylinders
representing the different axes.
WARNING: This function doesn't work in gnuplot (as of version 4.2).
See also: drawAxisCube.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Draw a coordinate system and an origin
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
drawBox3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 689
-- Function File: drawBox3d ( BOX)
-- Function File: drawBox3d ( ...,OPT)
Draw a 3D box defined by coordinate extents
Draw a box defined by its coordinate extents: BOX = [XMIN XMAX YMIN
YMAX ZMIN ZMAX]. The function draws only the outline edges of the
box. Extra options OPT are passed to the function 'drawEdges3d'.
Example
# Draw bounding box of a cubeoctehedron
[v e f] = createCubeOctahedron;
box3d = boundingBox3d(v);
figure; hold on;
drawMesh(v, f);
drawBox3d(box3d);
axis([-2 2 -2 2 -2 2]);
view(3)
See also: boxes3d, boundingBox3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Draw a 3D box defined by coordinate extents
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawCircle3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1949
-- Function File: H = drawCircle3d (CIRCLE2D, NORMAL)
-- Function File: H = drawCircle3d (XC, YC, ZC, R, THETA, PHI, PSI)
Draw a 3D circle
Possible calls for the function: drawCircle3d([XC YC ZC R THETA
PHI]) drawCircle3d([XC YC ZC R], [THETA PHI])
where XC, YC, ZY are coordinates of circle center, R is the circle
radius, PHI and THETA are 3D angles in degrees of the normal to the
plane containing the circle: * THETA between 0 and 180 degrees,
corresponding to the colatitude (angle with Oz axis). * PHI
between 0 and 360 degrees corresponding to the longitude (angle
with Ox axis)
drawCircle3d([XC YC ZC R THETA PHI PSI]) drawCircle3d([XC YC ZC R],
[THETA PHI PSI]) drawCircle3d([XC YC ZC R], THETA, PHI)
drawCircle3d([XC YC ZC], R, THETA, PHI) drawCircle3d([XC YC ZC R],
THETA, PHI, PSI) drawCircle3d([XC YC ZC], R, THETA, PHI, PSI)
drawCircle3d(XC, YC, ZC, R, THETA, PHI) drawCircle3d(XC, YC, ZC, R,
THETA, PHI, PSI) Are other possible syntaxes for this function.
H = drawCircle3d(...) return handle on the created LINE object
Example
# display 3 mutually orthogonal 3D circles
figure; hold on;
drawCircle3d([10 20 30 50 0 0], 'LineWidth', 2, 'Color', 'b');
drawCircle3d([10 20 30 50 90 0], 'LineWidth', 2, 'Color', 'r');
drawCircle3d([10 20 30 50 90 90], 'LineWidth', 2, 'Color', 'g');
axis equal;
axis([-50 100 -50 100 -50 100]);
view([-10 20])
# Draw several circles at once
center = [10 20 30];
circ1 = [center 50 0 0];
circ2 = [center 50 90 0];
circ3 = [center 50 90 90];
figure; hold on;
drawCircle3d([circ1 ; circ2 ; circ3]);
axis equal;
See also: circles3d, drawCircleArc3d, drawEllipse3d, drawSphere.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Draw a 3D circle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
drawCircleArc3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 558
-- Function File: drawCircleArc3d([ XC YC ZC R THETA PHI PSI START
EXTENT])
Draw a 3D circle arc
[XC YC ZC] : coordinate of arc center R : arc radius [THETA PHI] :
orientation of arc normal, in degrees (theta: 0->180). PSI : roll
of arc (rotation of circle origin) START : starting angle of arc,
from arc origin, in degrees EXTENT : extent of circle arc, in
degrees (can be negative)
Drawing options can be specified, as for the plot command.
See also: angles3, circles3d, drawCircle3d, drawCircleArc.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Draw a 3D circle arc
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawCube
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1186
-- Function File: H = drawCube (CUBE)
-- Function File: [X,Y,Z] = drawCube (CUBE)
Draw a 3D centered cube, eventually rotated
drawCube(CUBE) Displays a 3D cube on current axis. CUBE is given
by: [XC YC ZC SIDE THETA PHI PSI] where (XC, YC, ZC) is the CUBE
center, SIDE is the length of the cube main sides, and THETA PHI
PSI are angles representing the cube orientation, in degrees.
THETA is the colatitude of the cube, between 0 and 90 degrees, PHI
is the longitude, and PSI is the rotation angle around the axis of
the normal.
CUBE can be axis aligned, in this case it should only contain
center and side information: CUBE = [XC YC ZC SIDE]
The function drawCuboid is closely related, but uses a different
angle convention, and allows for different sizes along directions.
Example
# Draw a cube with small rotations
figure; hold on;
drawCube([10 20 30 50 10 20 30], 'FaceColor', 'g');
axis equal;
view(3);
WARNING: This function doesn't work in gnuplot (as of version 4.2).
See also: meshes3d, polyhedra, createCube, drawCuboid.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Draw a 3D centered cube, eventually rotated
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawCylinder
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1234
-- Function File: H = drawCylinder (CYL)
-- Function File: H = drawCylinder (CYL,N)
-- Function File: H = drawCylinder (..., OPT)
-- Function File: H = drawCylinder (..., "Facecolor",COLOR)
-- Function File: H = drawCylinder (...)
Draw a cylinder
drawCylinder(CYL) where CYL is a cylinder defined by [x1 y1 z1 x2
y2 z2 r]: [x1 y2 z1] are coordinates of starting point, [x2 y2 z2]
are coordinates of ending point, and R is the radius of the
cylinder, draws the corresponding cylinder on the current axis.
drawCylinder(CYL, N) uses N points for discretisation of angle.
Default value is 32.
drawCylinder(..., OPT) with OPT = 'open' (default) or 'closed',
specify if bases of the cylinder should be drawn.
drawCylinder(..., "FaceColor", COLOR) Specifies the color of the
cylinder. Any couple of parameters name and value can be given as
argument, and will be transfered to the 'surf' matlab function
H = drawCylinder(...) returns a handle to the patch representing
the cylinder.
Run 'demo drawCylinder' to see several examples.
WARNING: This function doesn't work in gnuplot (as of version 4.2).
See also: drawSphere, drawLine3d, surf.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Draw a cylinder
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawEdge3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
-- Function File: H = drawEdge (EDGE)
Draw 3D edge in the current Window
draw the edge EDGE on the current axis. EDGE has the form: [x1 y1
z1 x2 y2 z2]. No clipping is performed.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Draw 3D edge in the current Window
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
drawPoint3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 632
-- Function File: H = drawPoint3d (X, Y, Z)
-- Function File: H = drawPoint3d (COORD)
-- Function File: H = drawPoint3d (...)
Draw 3D point on the current axis.
drawPoint3d(X, Y, Z) will draw points defined by coordinates X and
Y. X and Y are N*1 array, with N being number of points to be
drawn.
drawPoint3d(COORD) packs coordinates in a single [N*3] array.
drawPoint3d(..., OPT) will draw each point with given option. OPT
is a string compatible with 'plot' model.
H = drawPoint3d(...) Also return a handle to each of the drawn
points.
See also: points3d, clipPoints3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Draw 3D point on the current axis.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
drawPolygon3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 611
-- Function File: H = drawPolygon3d (POLY)
-- Function File: H = drawPolygon3d (PX,PY,PZ)
-- Function File: H = drawPolygon3d (...,PARAM,VALUE)
Draw a 3D polygon specified by a list of vertices
drawPolygon3d(POLY); packs coordinates in a single N-by-3 array.
drawPolygon3d(PX, PY, PZ); specifies coordinates in separate
arrays.
drawPolygon3d(..., PARAM, VALUE); Specifies style options to draw
the polyline, see plot for details.
H = drawPolygon3d(...); also return a handle to the list of line
objects.
See also: polygons3d, fillPolygon3d, drawPolyline3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Draw a 3D polygon specified by a list of vertices
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
drawPolyline3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 868
-- Function File: H = drawPolyline3d (POLY)
-- Function File: H = drawPolyline3d (PX,PY,PZ)
-- Function File: H = drawPolyline3d (...,CLOSED)
-- Function File: H = drawPolyline3d (...,PARAM,VALUE)
Draw a 3D polyline specified by a list of vertices
drawPolyline3d(POLY); packs coordinates in a single N-by-3 array.
drawPolyline3d(PX, PY, PZ); specify coordinates in separate arrays.
drawPolyline3d(..., CLOSED); Specifies if the polyline is closed or
open. CLOSED can be one of: - 'closed' - 'open' (the default) - a
boolean variable with value TRUE for closed polylines.
drawPolyline3d(..., PARAM, VALUE); Specifies style options to draw
the polyline, see plot for details.
H = drawPolyline3d(...); also return a handle to the list of line
objects.
See also: polygons3d, drawPolygon3d, fillPolygon3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Draw a 3D polyline specified by a list of vertices
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawSphere
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1090
-- Function File: = function_name (, )
Draw a sphere as a mesh
drawSphere(SPHERE) Where SPHERE = [XC YC ZC R], draw the sphere
centered on the point with coordinates [XC YC ZC] and with radius
R, using a quad mesh.
drawSphere(CENTER, R) Where CENTER = [XC YC ZC], specifies the
center and the radius with two arguments.
drawSphere(XC, YC, ZC, R) Specifiy sphere center and radius as four
arguments.
drawSphere(..., NAME, VALUE); Specifies one or several options
using parameter name-value pairs. Available options are usual
drawing options, as well as: 'nPhi' the number of arcs used for
drawing the meridians 'nTheta' the number of circles used for
drawing the parallels
H = drawSphere(...) Return a handle to the graphical object
created by the function.
[X Y Z] = drawSphere(...) Return the coordinates of the vertices
used by the sphere. In this case, the sphere is not drawn.
Run 'demo drawSphere' to see several examples.
See also: spheres, circles3d, sphere, drawEllipsoid.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Draw a sphere as a mesh
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
drawSphericalEdge
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 319
-- Function File: drawSphericalEdge ( SPHERE, EDGE)
Draw an edge on the surface of a sphere
EDGE is given as a couple of 3D corodinates corresponding to edge
extremities. The shortest spherical edge joining the two
extremities is drawn on the current axes.
See also: drawSphericalPolygon.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Draw an edge on the surface of a sphere
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
drawSphericalPolygon
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 88
-- Function File: = drawSphericalPolygon (SPHERE, POLY)
Draw a spherical polygon
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Draw a spherical polygon
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
drawSphericalTriangle
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 163
-- Function File: H = function_name (SPHERE, P1,P2,P3)
Draw a triangle on a sphere
See also: drawSphere, fillSphericalTriangle, drawSphericalPolygon.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Draw a triangle on a sphere
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
drawTorus
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 529
-- Function File: drawTorus (TORUS)
Draw a torus (3D ring)
drawTorus(TORUS) Draws the torus on the current axis. TORUS is
given by [XC YC ZY R1 R2 THETA PHI] where (XC YZ ZC) is the center
of the torus, R1 is the main radius, R2 is the radius of the torus
section, and (THETA PHI) is the angle of the torus normal vector
(both in degrees).
Example
figure;
drawTorus([50 50 50 30 10 30 45]);
axis equal;
See also: drawEllipsoid, revolutionSurface.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Draw a torus (3D ring)
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawVector3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 318
-- Function File: H = function_name (POS, VECT)
Draw vector at a given position
Example
figure; hold on;
drawVector3d([2 3 4], [1 0 0]);
drawVector3d([2 3 4], [0 1 0]);
drawVector3d([2 3 4], [0 0 1]);
view(3);
See also: quiver3.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Draw vector at a given position
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
geom3d_Contents
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9111
-- Function File: geom3d_Contents ()
GEOM3D Geometry 3D Toolbox Version 1.0 21-Mar-2011 .
Creation, transformations, algorithms and visualization of
geometrical 3D primitives, such as points, lines, planes,
polyhedra, circles and spheres.
Euler Angles are defined as follow: PHI is the azimut, i.e. the
angle of the projection on horizontal plane with the Ox axis, with
value beween 0 and 180 degrees. THETA is the latitude, i.e. the
angle with the Oz axis, with value between -90 and +90 degrees.
PSI is the 'roll', i.e. the rotation around the (PHI, THETA)
direction, with value in degrees See also the 'angles3d' page.
Base format for primitives: Point: [x0 y0 z0] Vector: [dx dy dz]
Line: [x0 y0 z0 dx dy dz] Edge: [x1 y1 z1 x2 y2 z2] Plane: [x0 y0
z0 dx1 dy1 dz1 dx2 dy2 dz2] Sphere: [x0 y0 z0 R] Circle: [x0 y0 z0
R PHI THETA PSI] (origin+center+normal+'roll'). Cylinder: [X1 Y1
Z1 X2 Y2 Z2 R] Box: [xmin xmax ymin ymax zmin zmax]. Used for
clipping shapes.
Polygons are represented by N-by-3 array of points, the last point
is not necessarily the same as the first one. Points must be
coplanar.
Meshes and Polyhedra are represented by a couple of variables {V,
F}: V: N-by-3 array of vetrtices: [x1 y1 z1; ... ;xn yn zn]; F: is
either a [Nf*3] or [Nf*4] array containing reference for vertices
of each face, or a [Nf*1] cell array, where each cell is an array
containing a variable number of node indices. For some functions,
the array E of edges is needed. It consists in a Ne-by-2 array
containing indices of source and target vertices.
3D Points points3d - Description of functions operating on 3D
points midPoint3d - Middle point of two 3D points or of a 3D edge
isCoplanar - Tests input points for coplanarity in 3-space.
transformPoint3d - Transform a point with a 3D affine transform
distancePoints - Compute euclidean distance between pairs of 3D
Points clipPoints3d - Clip a set of points by a box drawPoint3d -
Draw 3D point on the current axis.
3D Vectors vectors3d - Description of functions operating on 3D
vectors transformVector3d - Transform a vector with a 3D affine
transform normalizeVector3d - Normalize a 3D vector to have norm
equal to 1 vectorNorm3d - Norm of a 3D vector or of set of 3D
vectors vectorAngle3d - Angle between two 3D vectors isParallel3d -
Check parallelism of two 3D vectors isPerpendicular3d - Check
orthogonality of two 3D vectors
Angles angles3d - Conventions for manipulating angles in 3D
anglePoints3d - Compute angle between three 3D points
sphericalAngle - Compute angle between points on the sphere
angleSort3d - Sort 3D coplanar points according to their angles in
plane randomAngle3d - Return a 3D angle uniformly distributed on
unit sphere
Coordinate transforms sph2cart2 - Convert spherical coordinates to
cartesian coordinates cart2sph2 - Convert cartesian coordinates to
spherical coordinates cart2sph2d - Convert cartesian coordinates to
spherical coordinates in degrees sph2cart2d - Convert spherical
coordinates to cartesian coordinates in degrees cart2cyl - Convert
cartesian to cylindrical coordinates cyl2cart - Convert cylindrical
to cartesian coordinates
3D Lines and Edges lines3d - Description of functions operating on
3D lines createLine3d - Create a line with various inputs.
transformLine3d - Transform a 3D line with a 3D affine transform
clipLine3d - Clip a line with a box and return an edge midPoint3d -
Middle point of two 3D points or of a 3D edge distancePointLine3d -
Euclidean distance between 3D point and line distanceLines3d -
Minimal distance between two 3D lines linePosition3d - Return the
position of a 3D point on a 3D line drawEdge3d - Draw 3D edge in
the current Window drawLine3d - Draw a 3D line on the current axis
Planes planes3d - Description of functions operating on 3D planes
createPlane - Create a plane in parametrized form normalizePlane -
Normalize parametric representation of a plane intersectPlanes -
Return intersection line between 2 planes in space
intersectLinePlane - Return intersection point between a plane and
a line intersectEdgePlane - Return intersection point between a
plane and a edge distancePointPlane - Signed distance betwen 3D
point and plane projPointOnPlane - Return the orthogonal projection
of a point on a plane isBelowPlane - Test whether a point is below
or above a plane medianPlane - Create a plane in the middle of 2
points planeNormal - Compute the normal to a plane planePosition -
Compute position of a point on a plane planePoint - Compute 3D
position of a point in a plane dihedralAngle - Compute dihedral
angle between 2 planes drawPlane3d - Draw a plane clipped in the
current window
3D Polygons and curves polygons3d - Description of functions
operating on 3D polygons polygonCentroid3d - Centroid (or center of
mass) of a polygon triangleArea3d - Area of a 3D triangle
polygon3dNormalAngle - Normal angle at a vertex of the 3D polygon
intersectLinePolygon3d - Intersection point of a 3D line and a 3D
polygon intersectLineTriangle3d - Intersection point of a 3D line
and a 3D triangle intersectRayPolygon3d - Intersection point of a
3D ray and a 3D polygon clipConvexPolygon3dHP - Clip a convex 3D
polygon with Half-space drawPolygon3d - Draw a 3D polygon specified
by a list of vertices drawPolyline3d - Draw a 3D polyline specified
by a list of vertices fillPolygon3d - Fill a 3D polygon specified
by a list of points
3D circles and ellipses circles3d - Description of functions
operating on 3D circles circle3dPosition - Return the angular
position of a point on a 3D circle circle3dPoint - Coordinates of a
point on a 3D circle from its position circle3dOrigin - Return the
first point of a 3D circle drawCircle3d - Draw a 3D circle
drawCircleArc3d - Draw a 3D circle arc drawEllipse3d - Draw a 3D
ellipse
Spheres spheres - Description of functions operating on 3D spheres
createSphere - Create a sphere containing 4 points
intersectLineSphere - Return intersection points between a line and
a sphere intersectPlaneSphere - Return intersection circle between
a plane and a sphere drawSphere - Draw a sphere as a mesh
drawSphericalTriangle - Draw a triangle on a sphere
Smooth surfaces inertiaEllipsoid - Inertia ellipsoid of a set of 3D
points intersectLineCylinder - Compute intersection points between
a line and a cylinder revolutionSurface - Create a surface of
revolution from a planar curve surfaceCurvature - Curvature on a
surface from angle and principal curvatures drawEllipsoid - Draw a
3D ellipsoid drawTorus - Draw a torus (3D ring) drawCylinder - Draw
a cylinder drawSurfPatch - Draw a 3D surface patch, with 2
parametrized surfaces
Bounding boxes management boxes3d - Description of functions
operating on 3D boxes point3dBounds - Bounding box of a set of 3D
points intersectBoxes3d - Intersection of two 3D bounding boxes
mergeBoxes3d - Merge 3D boxes, by computing their greatest extent
box3dVolume - Volume of a 3-dimensional box randomPointInBox3d -
Generate random point(s) within a 3D box drawBox3d - Draw a 3D box
defined by coordinate extents
Geometric transforms transforms3d - Conventions for manipulating 3D
affine transforms createTranslation3d - Create the 4x4 matrix of a
3D translation createScaling3d - Create the 4x4 matrix of a 3D
scaling createRotationOx - Create the 4x4 matrix of a 3D rotation
around x-axis createRotationOy - Create the 4x4 matrix of a 3D
rotation around y-axis createRotationOz - Create the 4x4 matrix of
a 3D rotation around z-axis createBasisTransform3d - Compute matrix
for transforming a basis into another basis eulerAnglesToRotation3d
- Convert 3D Euler angles to 3D rotation matrix
rotation3dToEulerAngles - Extract Euler angles from a rotation
matrix createRotation3dLineAngle - Create rotation around a line by
an angle theta rotation3dAxisAndAngle - Determine axis and angle of
a 3D rotation matrix recenterTransform3d - Change the fixed point
of an affine 3D transform composeTransforms3d - Concatenate several
space transformations
Various drawing Functions drawGrid3d - Draw a 3D grid on the
current axis drawAxis3d - Draw a coordinate system and an origin
drawAxisCube - Draw a colored cube representing axis orientation
drawCube - Draw a 3D centered cube, eventually rotated drawCuboid -
Draw a 3D cuboid, eventually rotated
Credits: * function isCoplanar was originally written by Brett
Shoelson. * Songbai Ji enhanced file intersectPlaneLine
(6/23/2006).
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
GEOM3D Geometry 3D Toolbox Version 1.0 21-Mar-2011 .
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
intersectLinePlane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1255
-- Function File: PT = intersectLinePlane (LINE, PLANE)
-- Function File: PT = intersectLinePlane (..., TOL)
Intersection point between a 3D line and a plane
PT = intersectLinePlane(LINE, PLANE) Returns the intersection point
of the given line and the given plane. LINE: [x0 y0 z0 dx dy dz]
PLANE: [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2] PT: [xi yi zi] If LINE
and PLANE are parallel, return [NaN NaN NaN]. If LINE (or PLANE) is
a matrix with 6 (or 9) columns and N rows, result is an array of
points with N rows and 3 columns.
PT = intersectLinePlane(LINE, PLANE, TOL) Specifies the tolerance
factor to test if a line is parallel to a plane. Default is 1e-14.
Example
# define horizontal plane through origin
plane = [0 0 0 1 0 0 0 1 0];
# intersection with a vertical line
line = [2 3 4 0 0 1];
intersectLinePlane(line, plane)
ans =
2 3 0
# intersection with a line "parallel" to plane
line = [2 3 4 1 2 0];
intersectLinePlane(line, plane)
ans =
NaN NaN NaN
See also: lines3d, planes3d, points3d, clipLine3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Intersection point between a 3D line and a plane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
intersectPlaneSphere
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 978
-- Function File: CIRC = intersectPlaneSphere( PLANE, SPHERE)
Return intersection circle between a plane and a sphere
Returns the circle which is the intersection of the given plane and
sphere. PLANE : [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2] SPHERE : [XS YS
ZS RS] CIRC : [XC YC ZC RC THETA PHI PSI] [x0 y0 z0] is the origin
of the plane, [dx1 dy1 dz1] and [dx2 dy2 dz2] are two direction
vectors, [XS YS ZS] are coordinates of the sphere center, RS is the
sphere radius, [XC YC ZC] are coordinates of the circle center, RC
is the radius of the circle, [THETA PHI] is the normal of the plane
containing the circle (THETA being the colatitude, and PHI the
azimut), and PSI is a rotation angle around the normal (equal to
zero in this function, but kept for compatibility with other
functions). All angles are given in degrees.
See also: planes3d, spheres, circles3d, intersectLinePlane,
intersectLineSphere.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Return intersection circle between a plane and a sphere
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
lines3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 369
-- Function File: lines3d ()
LINES3D Description of functions operating on 3D lines
A 3D Line is represented by a 3D point (its origin) and a 3D vector
(its direction): LINE = [X0 Y0 Z0 DX DY DZ];
See also: createLine3d, transformLine3d, distancePointLine3d,
linePosition3d intersectLinePlane, distanceLines3d, clipLine3d,
drawLine3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
LINES3D Description of functions operating on 3D lines
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
normalizePlane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 672
-- Function File: PLANE2 = normalizePlane (PLANE1)
Normalize parametric representation of a plane
PLANE2 = normalizePlane(PLANE1); Transforms the plane PLANE1 in the
following format: [X0 Y0 Z0 DX1 DY1 DZ1 DX2 DY2 DZ2], where: - (X0,
Y0, Z0) is a point belonging to the plane - (DX1, DY1, DZ1) is a
first direction vector - (DX2, DY2, DZ2) is a second direction
vector into another plane, with the same format, but with: - (x0 y0
z0) is the closest point of plane to the origin - (DX1 DY1 DZ1) has
norm equal to 1 - (DX2 DY2 DZ2) has norm equal to 1 and is
orthogonal to (DX1 DY1 DZ1)
See also: planes3d, createPlane.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Normalize parametric representation of a plane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
planeNormal
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 248
-- Function File: N = planeNormal (PLANE)
Compute the normal to a plane
N = planeNormal(PLANE) compute the normal of the given plane PLANE
: [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2] N : [dx dy dz]
See also: planes3d, createPlane.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Compute the normal to a plane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
planePosition
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 631
-- Function File: PT2 = planePosition (POINT, PLANE)
Compute position of a point on a plane
PT2 = planePosition(POINT, PLANE) POINT has format [X Y Z], and
plane has format [X0 Y0 Z0 DX1 DY1 DZ1 DX2 DY2 DZ2], where : - (X0,
Y0, Z0) is a point belonging to the plane - (DX1, DY1, DZ1) is a
first direction vector - (DX2, DY2, DZ2) is a second direction
vector
Result PT2 has the form [XP YP], with [XP YP] coordinate of the
point in the coordinate system of the plane.
CAUTION: WORKS ONLY FOR PLANES WITH ORTHOGONAL DIRECTION VECTORS
See also: planes3d, points3d, planePoint.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Compute position of a point on a plane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
planes3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 503
-- Function File: planes3d ()
PLANES3D Description of functions operating on 3D planes
Planes are represented by a 3D point (the plane origin) and 2
direction vectors, which should not be colinear. PLANE = [X0 Y0 Z0
DX1 DY1 DZ1 DX2 DY2 DZ2];
See also: createPlane, medianPlane, normalizePlane, planeNormal,
planePosition, dihedralAngle, intersectPlanes, projPointOnPlane,
isBelowPlane, intersectLinePlane, intersectEdgePlane,
distancePointPlane, drawPlane3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
PLANES3D Description of functions operating on 3D planes
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
points3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 417
-- Function File: points3d ()
POINTS3D Description of functions operating on 3D points
Points are represented by their 3 Cartesian coordinates: P = [X Y
Z];
Arrays of points consist in N*3 arrays, each row being a point.
See also: isCoplanar, distancePoints, anglePoints3d, angleSort3d,
sphericalAngle, sph2cart2, cart2sph2, cart2cyl, cyl2cart,
transformPoint3d, clipPoints3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
POINTS3D Description of functions operating on 3D points
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
polygonArea3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 387
-- Function File: AREA = polygonArea3d( POLY)
Area of a 3D polygon
POLY is given as a N-by-3 array of vertex coordinates. The
resulting area is positive.
Example
poly = [10 30 20;20 30 20;20 40 20;10 40 20];
polygonArea3d(poly)
ans =
100
See also: polygons3d, triangleArea3d, polygonArea,
polygonCentroid3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Area of a 3D polygon
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
polygons3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 576
-- Function File: polygons3d ()
POLYGONS3D Description of functions operating on 3D polygons
A 3D polygon is simply a set of 3D points (called vertices) which
are assumed to be located in the same plane. Several functions are
provided for computing basic geometrical parameters (centroid,
angles), or intersections with lines or planes.
See also: polygon3dNormalAngle, polygonCentroid3d,
clipConvexPolygon3dHP intersectLinePolygon3d,
intersectLineTriangle3d, intersectRayPolygon3d drawPolygon3d,
drawPolyline3d, fillPolygon3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
POLYGONS3D Description of functions operating on 3D polygons
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
projPointOnPlane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 617
-- Function File: PT2 = projPointOnPlane (PT1, PLANE)
Return the orthogonal projection of a point on a plane
PT2 = projPointOnPlane(PT1, PLANE); Compute the (orthogonal)
projection of point PT1 onto the line PLANE.
Function works also for multiple points and planes. In this case,
it returns multiple points. Point PT1 is a [N*3] array, and PLANE
is a [N*9] array (see createPlane for details). Result PT2 is a
[N*3] array, containing coordinates of orthogonal projections of
PT1 onto planes PLANE.
See also: planes3d, points3d, planePosition, intersectLinePlane.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Return the orthogonal projection of a point on a plane
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
revolutionSurface
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1823
-- Function File: [X, Y, Z] = revolutionSurface (C1, C2, N)
-- Function File: [X, Y, Z] = revolutionSurface (CURVE, N)
-- Function File: [X, Y, Z] = revolutionSurface (..., THETA)
-- Function File: [X, Y, Z] = revolutionSurface (..., LINE)
Create a surface of revolution from a planar curve
usage [X Y Z] = revolutionSurface(C1, C2, N); create the surface of
revolution of parametrized function (xt, yt), with N+1 equally
spaced slices, around the Oz axis. It assumed that C1 corresponds
to the x coordinate, and that C2 corresponds to the Oz coordinate.
[X Y Z] = revolutionSurface(CURVE, N); is the same, but generating
curve is given in a single parameter CURVE, which is a [Nx2] array
of 2D points.
[X Y Z] = revolutionSurface(..., THETA) where THETA is a vector,
uses values of THETA for computing revolution angles.
[X Y Z] = revolutionSurface(..., LINE); where LINE is a 1x4 array,
specifes the revolution axis in the coordinate system of the curve.
LINE is a row vector of 4 parameters, containing [x0 y0 dx dy],
where (x0,y0) is the origin of the line and (dx,dy) is a direction
vector of the line. The resulting revolution surface still has Oz
axis as symmetry axis. It can be transformed using
transformPoint3d function. Surface can be displayed using : 'H =
surf(X, Y, Z);' H is a handle to the created patch.
revolutionSurface(...); by itself, directly shows the created
patch.
Example
# draws a piece of torus
circle = circleAsPolygon([10 0 3], 50);
[x y z] = revolutionSurface(circle, linspace(0, 4*pi/3, 50));
surf(x, y, z);
axis square equal;
See also: surf, transformPoint3d, drawSphere, drawTorus,
drawEllipsoid.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Create a surface of revolution from a planar curve
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
sph2cart2
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 976
-- Function File: C = sph2cart2 (S)
-- Function File: C = sph2cart2 (THETA, PHI)
-- Function File: C = sph2cart2 (THETA, PHI, RHO)
-- Function File: [X Y Z]= sph2cart2 (...)
Convert spherical coordinates to cartesian coordinates
C = SPH2CART2(S) C = SPH2CART2(THETA, PHI) (assume rho = 1) C =
SPH2CART2(THETA, PHI, RHO) [X, Y, Z] = SPH2CART2(THETA, PHI, RHO);
S = [phi theta rho] (spherical coordinate). C = [X Y Z] (cartesian
coordinate)
The following convention is used: THETA is the colatitude, in
radians, 0 for north pole, +pi for south pole, pi/2 for points with
z=0. PHI is the azimuth, in radians, defined as matlab cart2sph:
angle from Ox axis, counted counter-clockwise. RHO is the distance
of the point to the origin. Discussion on choice for convention
can be found at:
http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf
See also: angles3d, cart2sph2, sph2cart, sph2cart2d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Convert spherical coordinates to cartesian coordinates
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
sph2cart2d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 920
-- Function File: C = sph2cart2d( THETA, PHI, RHO)
-- Function File: C = sph2cart2d( THETA, PHI)
-- Function File: C = sph2cart2d( S)
-- Function File: [X,Y,Z] = sph2cart2d( THETA, PHI, RHO)
Convert spherical coordinates to cartesian coordinates in degrees
C = SPH2CART2(THETA, PHI) assumes RHO = 1.
S = [THETA, PHI, RHO] (spherical coordinate). C = [X,Y,Z]
(cartesian coordinate)
The following convention is used: THETA is the colatitude, in
degrees, 0 for north pole, +180 degrees for south pole, +90 degrees
for points with z=0. PHI is the azimuth, in degrees, defined as
matlab cart2sph: angle from Ox axis, counted counter-clockwise.
RHO is the distance of the point to the origin. Discussion on
choice for convention can be found at:
<http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf>
See also: angles3d, cart2sph2d, sph2cart2.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Convert spherical coordinates to cartesian coordinates in degrees
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
spheres
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 688
-- Function File: spheres ()
Description of functions operating on 3D spheres
Spheres are represented by their center and their radius: S = [xc
yc zc r];
An ellipsoid is defined by: ELL = [XC YC ZC A B C PHI THETA PSI]
where [XC YC ZY] is the center, [A B C] are length of semi-axes (in
decreasing order), and [PHI THETA PSI] are euler angles
representing the ellipsoid orientation.
See also: createSphere, inertiaEllipsoid, intersectLineSphere,
intersectPlaneSphere, sphericalVoronoiDomain, drawSphere,
drawEllipsoid, drawSphericalEdge, drawSphericalTriangle,
drawSphericalPolygon, fillSphericalTriangle, fillSphericalPolygon.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Description of functions operating on 3D spheres
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
transformPoint3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1319
-- Function File: PT2 = transformPoint3d (PT1, TRANS)
-- Function File: PT2 = transformPoint3d (X1,Y1,Z1, TRANS)
-- Function File: [X2,Y2,Z2] = transformPoint3d (...)
Transform a point with a 3D affine transform
PT2 = transformPoint3d(PT1, TRANS); PT2 = transformPoint3d(X1, Y1,
Z1, TRANS); where PT1 has the form [xp yp zp], and TRANS is a
[3x3], [3x4], [4x4] matrix, return the point transformed according
to the affine transform specified by TRANS.
Format of TRANS is a 4-by-4 matrix.
The function accepts transforms given using the following formats:
[a b c] , [a b c j] , or [a b c j] [d e f] [d e f k] [d e f k] [g h
i] [g h i l] [g h i l] [0 0 0 1]
PT2 = transformPoint3d(PT1, TRANS) also work when PT1 is a
[Nx3xMxPxETC] array of double. In this case, PT2 has the same size
as PT1.
PT2 = transformPoint3d(X1, Y1, Z1, TRANS); also work when X1, Y1
and Z1 are 3 arrays with the same size. In this case, PT2 will be
a 1-by-3 cell containing {X Y Z} outputs of size(X1).
[X2 Y2 Z2] = transformPoint3d(...); returns the result in 3
different arrays the same size as the input. This form can be
useful when used with functions like meshgrid or warp.
See also: points3d, transforms3d, translation3d,meshgrid.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Transform a point with a 3D affine transform
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
vectorAngle3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 477
-- Function File: THETA = vectorAngle3d (V1, V2)
Angle between two 3D vectors
THETA = vectorAngle3d(V1, V2) Computes the angle between the 2 3D
vectors V1 and V2. The result THETA is given in radians, between 0
and PI.
Example # angle between 2 orthogonal vectors vectorAngle3d([1 0 0],
[0 1 0]) ans = 1.5708
# angle between 2 parallel vectors v0 = [3 4 5];
vectorAngle3d(3*v0, 5*v0) ans = 0
See also: vectors3d, vectorNorm.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Angle between two 3D vectors
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
vectors3d
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 408
-- Function File: vectors3d ()
VECTORS3D Description of functions operating on 3D vectors
Vectors are represented by their 3 Cartesian coordinates: V = [VX
VY VZ];
List of vectors are represented by N*3 arrays, with the coordinates
of each vector on a row.
See also: vectorNorm3d, normalizeVector3d, vectorAngle3d
isParallel3d, isPerpendicular3d, createTranslation3d.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
VECTORS3D Description of functions operating on 3D vectors
|