Consulting

Results 1 to 2 of 2

Thread: VBA App for producing Unit Circle values

  1. #1
    VBAX Tutor jamescol's Avatar
    Joined
    May 2004
    Location
    Charlotte, NC
    Posts
    251
    Location

    VBA App for producing Unit Circle values

    My daughter wants me to find out if it's possible to develop an Excel VB app that will reproduce the values of the Unit Circle (for her calculus class). The problem I'm running up against is that her classwork requires her to express answers in terms of PI and SQRT (e.g 3PI/SQRT2), not in a simplified decimal notation.

    The application needs to accept a radian (either positive or negative) as input, and then calculate and display (using PI and SQRT symbols) the Sin, Cos, Tan, Csc, Sec, Cot in terms of the standard Unit Circle x,y coordinates.

    I attached a diagram of the Unit Circle for reference. A specific example is:

    Input: PI/3
    Stored constants for this value are:
    x = 1/2
    y = SQRT3/2

    Calculations are:
    Degrees = Input * 180/PI
    R = SQRT(x^2 + y^2)
    Sin = y/R
    Cos = x/R
    Tan = y/x
    Csc = R/y
    Sec = R/x
    Cot = x/y

    (Some of these trigonometric values will result in a DIV/0! error, so I will need to trap that also)

    That's the minimum. Gravy for this app would be:

    1. A way to display the entire Unit Circle with labels for x,y, Rad, and Deg

    2. A way to display the standard graph for the given Rad along with all labels above

    Thanks for any advice or help.

    Cheers,
    James
    "All that's necessary for evil to triumph is for good men to do nothing."

  2. #2
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Hi jamescol,

    Perhaps using a loop to generate a number of values between zero and one to plot on a MS scatter chart would do it????

    I?ve used an in-built programme on Apple systems to do this (it?s much simpler), for plotting things on windows I now use a little programme called GRAPHER that I picked up from a PC tools disc, the help file contains this link - Grapher Web Page:

    http://students.washington.edu/bellc/grapher/ if you want to look at it.

    As far as the maths is concerned, for any that have the programming/coding skills and time to do this but perhaps not enough maths, the attachment below may save you having to look up text books:

Posting Permissions

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