maths in a program

This is a discussion on maths in a program within the C Programming forums, part of the General Programming Boards category; Hi guys. I know this isn't code but maths to go into a program, I need to know which is ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    41

    maths in a program

    Hi guys.
    I know this isn't code but maths to go into a program, I need to know which is right.

    I have a couple of formulae which need rearranging:

    1) Make r the subject of.
    a = 2pi(r + h)

    first multiply out the bracket 2pir + 2pih = a

    then subtract 2pih from both sides 2pir = a - 2pih

    now divide both sides by 2pi r = a - 2pih / 2ip ( this is the answer that I have ).


    2) make x the subject of.
    5(x + 2) = y

    first multiply out the bracket 5x + 10 = y

    then subtract 10 from both sides 5x = y - 10

    now divide both sides by 5 x = y - 10 / 5 ( stop here with this answer or do the maths on the right hand side giving x = y / 5 - 2 ) where do I stop with the answer.


    in question 1 I stopped as soon as the required subject was on its own but in question 2 i got the required subject on its own and then proceeded to simplify the maths on the rhs (which way is correct)


    THANKS for the help (learner wanting to be a master).

  2. #2
    Registered User
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    212
    Firstly, you went the long way around to get 'r' and 'x' the subjects.

    a= 2pi(r + h)
    a/2pi = r+h
    r = a/2pi -h

    5(x + 2) = y
    x + 2 = y/5
    x = y/5 - 2

    Simple. But if you understand the other way better stick to that. Second, if 'x' is the subject to be, go all the way, don't stop halfway through.

  3. #3
    Unregistered
    Guest
    anthony,
    kwigibo's answers are correct, whereas yours are missing parentheses. Your answers should be:
    r = (a - 2pih) / 2pi
    and
    x = (y - 10) / 5,
    which are equal to kwigibo's.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21