Thread: inverse of sine?

  1. #1
    That weird Java guy xniinja's Avatar
    Join Date
    Jun 2010
    Posts
    231

    inverse of sine?

    Hey guys, I just have a quick question. Is there a true inverse of sine? now I know that an inverse of sine wouldn't be a function, but what if we restricted it. then wouldn't you be able to make a kind-of inverse function?

    Ok I i'm just going to come out and say it, can you solve this? (for 'y' of course)

    Code:
    x=(sqrt(y-2)^2)+(sqrt(-y+4)^2)+sin(y)-2
    this question has been eating at my soul for the past few days and if someone could provide some in-site that would be great

    -thanks in advance

    actually I need it for x=0 to try to find Pi so in that case you can just solve this...


    Code:
    0=(sqrt(y-2)^2)+(sqrt(-y+4)^2)+sin(y)-2
    God... that's ugly.

    -thanks again

    btw: my logic has been all over the place lately so if something looks strange, that's why. like if i am using Pi to find Pi, that's what my friend told me I am doing...
    Last edited by xniinja; 12-13-2011 at 11:04 PM.

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    You can find the inverse of sine modulo 2*Pi, it's called arcsine.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    y = asin(x)

    If x is zero, so is y.

    Everything else cancels out. This equation gets you no closer to finding Pi.
    Last edited by nonoob; 12-15-2011 at 01:44 PM.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    If x is 0, y is not 0 (because of -2 term).
    That equation cannot be solved arithmetically AFAIK. You'd have to do it numerically.
    But solve an equation for finding Pi...? Why would you do that?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229

  6. #6
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    that would be insine.

    180 degrees out of phase of sin.

    <joke>

  7. #7
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    Huh Elysia?

    Here's how everything cancels out:

    Original:
    x = (sqrt(y-2)^2) + (sqrt(-y+4)^2) + sin(y) - 2

    Taking square-root then immediately squaring means you haven't done anything.
    This is of course assuming the argument doesn't go negative ... but one could use imaginary numbers and get away with it.

    x = (y - 2) + (-y + 4) + sin(y) - 2

    removing the parenthesis and moving the sin to the last

    x = y - 2 - y + 4 - 2 + sin(y)

    grouping variables and constants together

    x = y - y - 2 + 4 - 2 + sin(y)

    Things cancel out to give

    x = sin(y)

    Now if x is pinned at zero, y is zero. Or it could be any multiple of Pi since Sine is cyclical.
    Last edited by nonoob; 12-16-2011 at 09:24 AM.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Ah, I didn't think of sqrt as actual square root. I think I just saw them as sines or something. My bad.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Password:
    Join Date
    Dec 2009
    Location
    NC
    Posts
    587
    Quote Originally Posted by nonoob View Post
    Original:
    x = (sqrt(y-2)^2) + (sqrt(-y+4)^2) + sin(y) - 2

    Taking square-root then immediately squaring means you haven't done anything.
    This is of course assuming the argument doesn't go negative ... but one could use imaginary numbers and get away with it.

    x = (y - 2) + (-y + 4) + sin(y) - 2
    You can't do that; -y+4 isn't the same as (sqrt(4-y))^2, which actually reduced to |4-y|, where || is the absolute value function.

  10. #10
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by User Name: View Post
    You can't do that; -y+4 isn't the same as (sqrt(4-y))^2, which actually reduced to |4-y|, where || is the absolute value function.
    You are confusing sqrt(x^2) with (sqrt(x))^2 .
    It gives |x| only for the former...but the later remains x.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. values of sine
    By jacek in forum C Programming
    Replies: 2
    Last Post: 10-31-2009, 04:17 PM
  2. UDF to calculate sine
    By n3cr0_l0rd in forum C Programming
    Replies: 5
    Last Post: 02-26-2009, 08:02 AM
  3. Sine (Sin) Algorithm Help
    By StaticKyle in forum C Programming
    Replies: 52
    Last Post: 05-13-2008, 08:37 AM
  4. Sine approximation Help
    By What111 in forum C Programming
    Replies: 8
    Last Post: 11-04-2007, 06:22 PM
  5. How to program in the inverse sine function
    By Finchie_88 in forum C++ Programming
    Replies: 4
    Last Post: 03-13-2005, 11:56 PM