Data collection

  • Email
  • Sharebar
  • Email
1 reply [Last post]
Andy
Andy's picture
Offline
MathematicianTechnologistProfessional Blogger
Joined: 02/10/2010

One of the advantage of Logo Turtle Geometry is its natural ways of moving and turing in 3D space. You can use egocentric commands such as FORWARD, BACK, LEFT and RIGHT to turn any angle and move any distance. Virtually you can move to any place in the 3D sapce and heading any direction you like (or by accident). And when you do, you can ask the turtle about its location and direction by saying: PRINT POS or PRINT ORI. But if you are well planned, you can collect a set of coordinates or directions as you command the turtle to move and turn in the 3D space.

The following commands are created for the location and direction data collection. As usual, you comments are welcome to help me improve my design of VRMath2 Logo programming language.

collectposition variableName
collectlocation variableName
collectpos variableName 
Start collecting positions of the turtle into variable variableName as a Logo word. After this command, every change of position of the turtle will be collected. You can start moving the turtle to collect a path of coordinates. To commit the collected coordinates into the variable, please use ENDCOLLECT variableName command. Positions collected can be used as the path for the TRAVEL command.
collectdirection variableName
collectorientation variableName
collectori variableName 
Start collecting orientations of the turtle into variable variableName as a Logo word. After this command, every change of direction of the turtle will be collected. You can start turning the turtle to collect a set of directions. To commit the collected directions into the variable, please use ENDCOLLECT variableName command. Orientations collected can be used as the directions for the ORIENT command.
endcollect variableName 
End collection and set the variable variableName as a Logo word in Logo.

Here is an example about data collection of a pentagon path, for a ball to travel on the pentagon.

Below is the Logo program.

Any comments?

mathskid
mathskid's picture
Offline
Joined: 09/07/2014
Wow

Wowsurprise