To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1271
1270  |  1272
Subject: 
Trigonometry and NQC
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 12 Dec 2001 23:17:06 GMT
Viewed: 
2954 times
  
Hi!

I'm working on a project where a robot needs to travel a right triangle with
unkown side lengths.  Basically, the robot starts at a point in a room,
travels perpendicularly toward a wall, turns 90 degrees left when it hits,
and when it gets to the corner needs to return to the starting point in the
room (somewhere).  No marks or other guides are provided to help the robot
find the starting point, but it can obviously measure the distance (or the
time) of the two perpendicular legs.  I could complete the course making a
square instead of a triangle, but that's not very elegant.

I prefer NQC as my Mindstorms programming tool, but it isn't apparent to me
that it supports trig functions.

Can anyone offer any suggestions?

Thanks,

Rich



Message has 3 Replies:
  Re: Trigonometry and NQC
 
Hi Richard, No, NQC does not implement any of the trig functions. However, you can do it yourself. The idea is to use a second order polynomial to approximate the sine function. You can get pretty good accuracy (within about 5%) if you break up the (...) (23 years ago, 12-Dec-01, to lugnet.robotics.rcx.nqc)
  Re: Trigonometry and NQC
 
(...) Hi Rich, there are no trig functions, because there's no float. I had the same problem and was able to approximate these values. I created two tables with the necessary values. The first table includes the values of the tangens of a angle. (...) (23 years ago, 13-Dec-01, to lugnet.robotics.rcx.nqc)
  Re: Trigonometry and NQC
 
(...) Hi Rich, Have a look at (URL) where you can find various tips around trig-functions under the restriction of integer values. Claude (23 years ago, 13-Dec-01, to lugnet.robotics.rcx.nqc)

5 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR