PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Sin Cos Tan-VBForums
Results 1 to 17 of 17

Thread: Sin Cos Tan

  1. #1

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668

    Sin Cos Tan

    What are these on the computer? Like to get SIN 45, what do I type?

    ex.
    (label1.caption = SIN45)

    also, what are SQUAREROOT and ABS function?
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,346
    VB Code:
    1. Private Sub Command1_Click()
    2. MsgBox (Sqr(txtSqrRoot.Text))
    3. End Sub

    Tells you the square root of the number in the text box.

    VB Code:
    1. Private Sub Command1_Click()
    2. MsgBox (Sin(45))
    3. End Sub

    Will tell you the sine of the angle.
    Last edited by Nightwalker83; Dec 7th, 2003 at 07:42 PM.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    ok thx, what about cos sin and tan?
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,346
    Use the following to find the cosine of a number.

    VB Code:
    1. Private Sub Command1_Click()
    2. MsgBox (Cos(45)) ' Replace 45 with the number you want.
    3. End Sub

    Use the following to the tangent of an angle.

    VB Code:
    1. Private Sub Command1_Click()
    2. MsgBox (Tan(45))
    3. End Sub

    The sin function is in my other post.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    then why is this piece of code not working?
    VB Code:
    1. Line2.Y2 = 2000 - (1500 * (Sin(AngleI)))
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  6. #6
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    There must be something wrong with the rest of your code (or the way you've used the formula), because i see no reason why that shouldn't do what it's supposed to. Although of course it might draw the line in a wierd place because of incorrect values.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  7. #7

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    and why is SIN in blue when I post it in the forume but not when i'm coding in my visual basic?
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  8. #8

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    here, if anyone could check it out for me, thanks
    Attached Files Attached Files
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  9. #9
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    It's blue here because the designers of this forum decided that sin was used often enough by people that it should be lighlighted along with keywords.

    As for VB, mine doesn't highlight it either, so that doesn't matter.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  10. #10
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Use this instead:

    VB Code:
    1. N2 = Val(Text1.Text)
    2. [b]    Line2.Y2 = 2000 - (1500 * Sin(AngleI * 3.14159 / 180))
    3.     Line2.X2 = 3000 + (1500 * Cos(AngleI * 3.14159 / 180))[/b]
    4. End Sub

    Sin, Cos, and Tan use radians instead of degrees so you have to multiply by Pi / 180. You'd get a very slight speed boost by making Pi / 180 a constant and using that, although it doesn't matter unless you're going to be calling this procedure exceedingly often.

    Edit: ABS is Abs
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  11. #11

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    ok thx a lot!!!!

    now how do I find the refracted light? this isnt working

    VB Code:
    1. Private Sub HScroll1_Change()
    2.     If Val(Text1.Text) <= 0 Then
    3.         Reponse = MsgBox("Veuillez entrez un indice de refraction plus grand que 0", vbOKOnly + vbCritical, "Indice de refraction impossible")
    4.         Exit Sub
    5.     End If
    6.    
    7.     Line2.Visible = True
    8.     Line3.Visible = True
    9.     AngleI = HScroll1.Value
    10.     N2 = Val(Text1.Text)
    11.    
    12.     Line2.Y2 = 2000 - (1500 * Sin(AngleI * 3.141592 / 180))
    13.     Line2.X2 = 3000 + (1500 * Cos(AngleI * 3.141592 / 180))
    14.    
    15.     AngleR = (Sin(AngleI * 3.141592 / 180)) / N2
    16.    
    17.     Line3.Y2 = 2000 + (1500 * Sin(AngleR * 3.141592 / 180))
    18.     Line3.X2 = 3000 - (1500 * Cos(AngleR * 3.141592 / 180))
    19. End Sub
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  12. #12

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    oh wait, I found my mistake, but now I need someone to tell me what Sin-1 is in VB!!
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  13. #13
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174
    ArcSin(X)

  14. #14

  15. #15

    Thread Starter
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668
    funny, I don't have this great utility installed, thats why I ask.

    ArcSin(X) doesn't work though
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  16. #16
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174
    Originally posted by Alien_poo
    funny, I don't have this great utility installed, thats why I ask.

    ArcSin(X) doesn't work though
    I thought you'd be aware of writing this function. I put it in your other post, which I can't find atm.

  17. #17
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Inverse Sin = Atn(X / Sqr(-X * X + 1))
    Inverse Cos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)

    From the derived math section of MSDN (F1). There is an online collection as well: http://msdn.microsoft.com/
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width