Shop OBEX P1 Docs P2 Docs Learn Events
A bit of help with algebra — Parallax Forums

A bit of help with algebra

NWUpgradesNWUpgrades Posts: 292
edited 2009-04-16 03:29 in BASIC Stamp
OK, So I skipped more school than·I honestly should have, so now that I need Algebra I am a bit lost. At 47 years old it may be time to go brush up a bit. Any how, I am working on the BoeBot and having a blast doing it. However, I have run in to an issue that I can not resolve. I need to calibrate my photo resistors. I have the following values:

In Ambient Light: timeLeft: 26 timeRight: 46

In low light: timeLeft: 203 timeRight: 377

I am trying right now to figure this out using Appendix F in the BoeBot manual, but I am getting totally lost. Could someone explain how to do this in plain ol laments terms as opposed to the normal math terms? I am not looking for a handout or for anyone to do the math (unless you really want to!!!) I just need some guidance in Algebra. Thanks for any help you can provide.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-16 03:20
    You just plug the numbers into the formulas. You basically have two points on a graph and you're drawing a line through the points. "m" is the slope of the line and "b" is the Y-intercept. The Wikipedia has some articles on these terms.

    slope = m = (y2 - y1) / (x2 - x1) = (377 - 46) / (203 - 26) = 331 / 177 = 1.87

    intercept = b = y2 - m * x2 = 377 - 1.87 * 203 = 377 - 380 = 3

    With these values, you can compute timeRight for any timeLeft. By reversing the formula, you can also compute timeLeft for any timeRight.

    timeRight = m * timeLeft + b = 1.87 * timeLeft + 3
  • NWUpgradesNWUpgrades Posts: 292
    edited 2009-04-16 03:29
    Not sure I understand. Do I put this in the program?
Sign In or Register to comment.