1234 |
- <xml xmlns="http://blockscad.einsteinsworkshop.com"><version num="1.1.2"></version><block type="controls_for" id="1625" x="-591" y="-583"><field name="VAR">i</field><comment pinned="true" h="141" w="541">Trigonometric functions take degree inputs.
- Use a loop to plot a square whose height is sin(i).
- Squares cannot have a negative height, so rotate half the sin function around the Z axis to make negative half (mirror and translate would also work for this).
- You could make this plot smoother by using a chain hull loop.</comment><value name="FROM"><block type="math_number" id="1626"><field name="NUM">0</field></block></value><value name="TO"><block type="math_number" id="1627"><field name="NUM">180</field></block></value><value name="BY"><block type="math_number" id="1628"><field name="NUM">1</field></block></value><statement name="DO"><block type="translate" id="1660"><value name="XVAL"><block type="math_arithmetic" id="1699"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="1700"><field name="VAR">i</field></block></value><value name="B"><block type="math_number" id="1701"><field name="NUM">0.25</field></block></value></block></value><value name="YVAL"><block type="math_number" id="1662"><field name="NUM">0</field></block></value><value name="ZVAL"><block type="math_number" id="1663"><field name="NUM">0</field></block></value><statement name="A"><block type="square" id="1597"><field name="CENTERDROPDOWN">false</field><value name="XVAL"><block type="math_number" id="1598"><field name="NUM">0.25</field></block></value><value name="YVAL"><block type="math_arithmetic" id="1680"><field name="OP">MULTIPLY</field><value name="A"><block type="math_trig" id="1718"><field name="OP">SIN</field><value name="NUM"><block type="variables_get" id="1698"><field name="VAR">i</field></block></value></block></value><value name="B"><block type="math_number" id="1599"><field name="NUM">10</field></block></value></block></value></block></statement></block></statement></block><block type="simplerotate" id="1817" x="-591" y="-403"><value name="XVAL"><block type="math_angle" id="1818"><field name="NUM">0</field></block></value><value name="YVAL"><block type="math_angle" id="1819"><field name="NUM">0</field></block></value><value name="ZVAL"><block type="math_angle" id="1820"><field name="NUM">180</field></block></value><statement name="A"><block type="controls_for" id="1821"><field name="VAR">i</field><value name="FROM"><block type="math_number" id="1822"><field name="NUM">0</field></block></value><value name="TO"><block type="math_number" id="1823"><field name="NUM">180</field></block></value><value name="BY"><block type="math_number" id="1824"><field name="NUM">1</field></block></value><statement name="DO"><block type="translate" id="1825"><value name="XVAL"><block type="math_arithmetic" id="1826"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="1827"><field name="VAR">i</field></block></value><value name="B"><block type="math_number" id="1828"><field name="NUM">0.25</field></block></value></block></value><value name="YVAL"><block type="math_number" id="1829"><field name="NUM">0</field></block></value><value name="ZVAL"><block type="math_number" id="1830"><field name="NUM">0</field></block></value><statement name="A"><block type="square" id="1831"><field name="CENTERDROPDOWN">false</field><value name="XVAL"><block type="math_number" id="1832"><field name="NUM">0.25</field></block></value><value name="YVAL"><block type="math_arithmetic" id="1833"><field name="OP">MULTIPLY</field><value name="A"><block type="math_trig" id="1834"><field name="OP">SIN</field><value name="NUM"><block type="variables_get" id="1835"><field name="VAR">i</field></block></value></block></value><value name="B"><block type="math_number" id="1836"><field name="NUM">10</field></block></value></block></value></block></statement></block></statement></block></statement></block></xml>
|