Beginners Tangent help

I am new to programming and am trying really hard to understand some things but I am unclear on the trigonometry side of programming.
I know how to work out the stuff on a calculator but not in visual basic
I am trying to divide a number by inverse tan but have no idea how to do that.
This is what I have so far
Ang1 = TextBox1.Text
radians1 = Ang1 * (Math.PI / 180)
Ang1R = Math.Tan(radians1)
Ang1H = Ang1R * 1000
Ang2 = TextBox2.Text
radians2 = Ang2 * (Math.PI / 180)
Ang2R = Math.Tan(radians2)
Ang2L = Ang1H / Ang2R
RidgeAng = Ang2L / 1000
RidgeAng1 = Math.Tan(RidgeAng)
Basically you add an angle in degrees into textbox1 and textbox2 to work out an angle at which each meets. It is actually to do with working out a hip roof for architectural drafting.
The basic formula should be like this:
textbox1 = 30deg tan * 1000 = 577.35
textbox2 = 577.35 / 20deg tan = 1586.2560881221264
ridge-angle = 1586.25 / 1000 /tan-1
hip-angle = 90 - ridge-angle
Any help would be really appreciated. I am new to programming and not that good at maths so please be clear in your explanation.
Thank you.

Hi, thanks for the reply. Yes, I didn't show the Dims or the text box output code.
Here is the full code:
Public Class Form1
Private Sub Calculate_Click(sender As Object, e As EventArgs) Handles Calculate.Click
Dim Ang1
Dim Ang2
Dim radians1 As Double
Dim radians2 As Double
Dim Ang1R As Double
Dim Ang2R As Double
Dim Ang1H As Double
Dim Ang2L As Double
Dim RidgeAng
Dim RidgeAng1
Dim RidgeAng2
Dim HipAng
Ang1 = TextBox1.Text
radians1 = Ang1 * (Math.PI / 180)
Ang1R = Math.Tan(radians1)
Ang1H = Ang1R * 1000
Ang2 = TextBox2.Text
radians2 = Ang2 * (Math.PI / 180)
Ang2R = Math.Tan(radians2)
Ang2L = Ang1H / Ang2R
RidgeAng = 1000 / Ang2L
RidgeAng1 = Math.Atan(RidgeAng)
RidgeAng2 = Convert.ToDecimal(RidgeAng1 * (180 / Math.PI))
'Label4.Text = Ang1H
'Label5.Text = Ang2L
HipAng = 90 - RidgeAng2
RidgeAngle.Text = RidgeAng2
HipAngle.Text = HipAng
End Sub
End Class
I have also attached an image of the problem.The image is a 2D plan view of a roof. The roof is a 3D shape in reality. 2 sides of the roof are 30degrees and the other side 20degrees. I wanted to know the angle of the line (called a hip). In the image, this
angle is shown as 57.77degrees.
That was what I wanted to work out. Not sure if that makes sense to you. The way I determined the 57.77 degrees was by working out where the 30degree roof and 20 degree roof height would intersect. In this case the height is 577.35mm. For the 20degree roof
to get to that height, it would need to be at a distance of 1586.25mm perpendicular to the edge of the roof.
Does that make sense?
http://thirdistudio.com.au/roofangles-Model.jpg
It sort of makes sense.
I just meant we dont know what you mean, exactly. I looked at your picture and you are mixing horz and vertical angles so that I am not sure what you are doing and the result you are after.
Here is a vertical section through the roof showing some possible angles. We cant be sure which one you mean.
It does not matter if you have already figured out what you want now no need to hash it out.

Similar Messages

  • Beginners swing help

    Hi, Im reading a beginners tutorial to swing located on this site.
    import javax.swing.*;
    public class HelloWorldSwing {
    private static void createAndShowGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame frame = new JFrame("HelloWorldSwing");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JLabel label = new JLabel("Hello World bla blah blah");
    JButton button = new JButton("Iam A BUTTON");
              int width = 300;
              int height = 300;
         frame.setSize(width, height);
         frame.pack();
    frame.setVisible(true);
              JPanel panel = new JPanel(new GridLayout(0,1));
              panel.add(button);
              panel.add(label);
              panel.setBorder(BorderFactory.createEmptyBorder());
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
         public void run() {
         createAndShowGUI();
    This is the code I am using, since I tryed to make the Jpanel I get this error when I try to compile it
    HelloWorldSwing.java:20: cannot find symbol
    symbol : class GridLayout
    location: class HelloWorldSwing
              JPanel panel = new JPanel(new GridLayout(0,1));
    ^
    1 error
    Can anyone tell me why? thanks

    import java.awt.GridLayout;

  • Beginners wireless help sought

    Hi, I have a flat panel iMac with cable broadband running Tiger. I want to set up a wireless connection which can be shared with a windows laptop...
    I'm an absolute beginner with wireless...where do I start?! eg will any wireless router be compatible?
    Many thanks for any help!
    G4 iMac   Mac OS X (10.4.7)  

    moon_goddess, 
    Greetings from Wiltshire (where I work).
    Firstly, do you already have a broadband provider? If not then when you choose one ask that they provide a wireless router (most will charge a small fee for this - but it's usually cheaper than buying the router seperately).
    If you already have a Broadband connection you need to get yourself a Wireless Router to connect your current broadband modem to. These can be bought in any PC World, Staples or widely available on the internet. Some broadband modems are USB and so both undesirable for Mac use and won't connect to a Router. You may prefer to buy a combined modem/router which reduces the electrical sockets and cables required.
    Next you need to decide how to connect your iMac:
    Ethernet - just use the supplied Ethernet cable which comes with the Router.
    Wireless - use the Airport Card in your Mac. To see if you have one installed go to Apple Menu > About this Mac > More Info > Airport.
    If will also help if you could post your processor speed which can be found in the same way.
    I recently posted this diagram for another thread but it applies to you to.
    Any router should be fine and will work exactly the same with a PC as a Mac (WiFi is an international standard (802.11)).
    regards
    mrtotes

  • Banking System  Help me!

    how do u write the codes for this program? i'm beginners plz help me!
    Develop a banking system using object-oriented programming. The system will have a bank object, and customer objects.
    The details of the classes and their operations are as shown below:
    Classes Required:
    1. Class Bank (startup class)
    2. Class Customer
    3. Class FixCustomer and Class SavingCustomer
    Details of each class:
    Class Bank:
    Attributes - Information about the customer:
         a. Total number of customers registered (i.e. use an array to hold an array of customer objects)
    Behaviour - Bank's operations:
         a. Show Customer's balance
         b. Calculate & show Customer's interest
         c. Update customer's balance (e.g. after withdraw or deposit)
    This is the startup class. Create an interface that allows a potential customer to register. Also, an interface for registered user to access his/her account.
    Class Customer:
    Attributes - Information about a customer:
         a. Customer Name
         b. Customer Account number
         c. Customer Address
         d. Customer Phone Number
         e. Customer Job
         f. Customer Balance
    Behaviour - Customer's actions:
         a. Check account information (e.g. Balance )
         b. Withdraw
         c. Deposit
         d. Transfer (i.e. transferring credits from one user account to another)
    *Interest value for saving-account (Interest 5%), and fix-account (Interest 7%). These different interest values are declared in the SavingCustomer and FixCustomer classes.

    Do it yourself!
    If you want someone else to do it, offer some money :)

  • Problem with calling a function within a function

    My problem is with the getWidth and getLength functions. The problem I am having is with the fact that when I get an incorrect input I pass it through the function again, which give me a weird return. The return I get is the correct input plus all the previous incorrect inputs after that. The one that gets returned is first incorrect input? I don't know if you understand, but I would appreciate help for this beginner.
    **Sorry about posting in this forum... I just realized this is not for beginners. Help would still be appreciated.**
    import java.util.Scanner;
    //Calculates the area of a rectangle
    public class AreaRectangle {
        private static Scanner c = new Scanner(System.in);
        private static boolean isNumber(String in) {
            boolean isNum = false;
            int count = 0;
            for (int i=0;i<in.length();i++) {
                if (in.charAt(i) >= '0' && in.charAt(i) <= '9' || in.charAt(i) == '.') {
                    if (in.charAt(i) == '.') {count++;}
                    else if (count > 1){isNum=false;break;}
                    else {isNum = true;}
                else {
                    isNum=false;
                    break;
            return isNum;
        public static double getLength() {
            String input;
            boolean isNum;
            double length = 0;
            System.out.print("Please enter the rectangle's length: ");
            input = c.nextLine();
            isNum = isNumber(input);
            if (isNum) {
                length = Double.parseDouble(input);
            else {
                System.out.println("Incorrect input!");
                getLength();
            System.out.println(input);
            return length;
        public static double getWidth() {
            String input;
            boolean isNum;
            double width = 0;
            System.out.print("Please enter the rectangle's width: ");
            input = c.nextLine();
            isNum = isNumber(input);
            if (isNum) {
                width = Double.parseDouble(input);
            else {
                System.out.println("Incorrect input!");
                getWidth();
            System.out.println(input);
            return width;
        public static double getArea(double length, double width) {
            return width*length;
        public static void displayData(double length, double width, double area) {
            System.out.println("Width = "+width+" "+"Length = "+length+" "+"Area = "+area);
        public static void main(String[] args) {
            double l, w, a;
            l = getLength();
            w = getWidth();
            a = getArea(l, w);
            displayData(l, w, a);
    }Edited by: x713 on Apr 12, 2008 7:12 PM
    Edited by: x713 on Apr 12, 2008 7:19 PM

    You're calling things recursively and that's not good (at least not here).
    To clarify, please look:
        public static double getLength() {
            if (something) {
                do something else
            else {
                System.out.println("Incorrect input!");
                getLength();  // you call the entire method again here! This is the recursive call
        }Better is to have a while loop inside the method and repeat this loop until the input that the user enters is correct (or until they quits).

  • Need to Learn ABAP OO and Workflow concepts.

    Hello Mates,
    I am just a 2 weeks old in Sap - ABAP, I was working on MS-.NET.
    But somehow ABAP is attracting me more than any other  language, I did certification as well.
    But somehow I am not able to understand the ABAP OO concepts inregards to workflow and exactly how to apply.
    I am reading every thread related to this from last 3 weeks now but didnt get any link/satisfactory answer to how to enhance my skill and use my OO knowledge of .NET in ABAP.
    I am very much familiar with OO concepts and dont want to read those again, but what I exactly want to read about
    1. THE SIGNIFICANCE OF OO IN ABAP.
    2. WHERE TO APPLY/ MAY BE HOW TO USE THOSE.
    3. ANYTHING RELATED TO ABAP WORKFLOW.
    if anyone used/or have knowledge of any such book/forum/blog/posts/sdn.forum/ please do let me know.
    This will help me in great level.
    Please do let me know, any kind of suggestions/critisism are welcome.
    I trust in your critisism also there will be something to read.
    Please post.
    Thanks and Regards,
    Ravindra Sonar.

    Your behavior is the only thing that counts here. And you look like a nice guy. If you would like to drop me a line in future, you can do that, I don´t mind, maybe we could find topics to talk about. And about that abap feature/ future post... I don´t care about the points (I don´t ask for any...) but the points count is the indicator of ones behavior:
    The guy, who always asks and nobody answers is selfish and not a candidate for me to answer. You must help to get helped, that is my motto. You must prove you´re worth the time and effort.
    I asked a question under B1 forum once where the top 1 contributor there tried hard to help because he knew I am active around here. That was a nice feeling. And from my point of view... get some points to prove you´re a nice guy and I will do my best to help you with any problem that may appear. I am not the only one who thinks this way, I think.
    But that is not a rule here, just my opinion.
    Maybe... one day, you will remember my words and write a blog for the beginners or help in some way to pay back what you have learnt here. Become a member of the community, spread the knowledge... and let´s talk:))
    Have a nice day, Otto

  • ABAP material Required

    Hi All,
        I am very new to this.I need materials for ABAP beginners.Please help me regarding this.
    thanks
    surya

    Hi Surya,
    Go thru this material.It will be very useful for u.
    http://www.sap-img.com/ge002.htm
    Need docs and examples of ABAP?
    http://esnips.com/doc/d27df392-bb18-4f72-8f36-c841f213f64c/SDNimp_urls.txt
    http://help.sap.com/saphelp_apo/helpdata/en/7e/63fc37004d0a1ee10000009b38f8cf/frameset.htm
    http://www.sap-img.com/sap-apo.htm
    go through these links .
    http://www.camelot-idpro.de/fileadmin/content_admin/downloads_en/Basell_print_englisch.pdf
    http://wp.bitpipe.com/resource/org_1111097862_533/SCM_APO_edp.pdf?site_cd=fbs
    http://whitepapers.sapinsideronline.com/
    http://www.sap.com/services/education/index.epx
    http://www.sap-img.com/ab040.htm
    http://www.sapdomain.com/testimonials.php
    http://www.planetsap.com/Abap_certification_requirements.htm
    http://www50.sap.com/useducation/curriculum/group.asp?tid=8
    http://www50.sap.com/useducation/curriculum/curriculum.asp?rid=256&TID=
    http://www.amazon.com/exec/obidos/ASIN/0071341617/qid=1120754726/sr=2-1/ref=pd_bbs_b_2_1/103-7699884-1772649
    thanks
    Anirudh

  • Basic Webdynpro ABAP Documents

    Hi All,
             Please provide me any basic Webdynpro Documents for starters...
    Regards,
    Susil.

    hi Sushil ,
    Web Dynpro ABAP is the SAP standard UI technology for developing Web applications in the ABAP
    environment.
    Web Dynpro offers the following advantages for application developers:
    1 The use of declarative and graphical tools significantly reduces the implementation effort
    2 Web Dynpro supports a structured design process
    3  Strict separation between layout and business data
    4 Reuse and better maintainability by using components
    5 The layout and navigation is easily changed using the Web Dynpro tools
    6 Stateful applications are supported u2013 that is, if the page is changed and the required data
    remains intact so that you can access it at any time throughout the entire application
    context.
    refer this video demonstration by thomas :
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414900)ID1595731150DB10653609238059682155End?blog=/pub/wlg/3861
    refer this SAP online help
    http://help.sap.com/saphelp_nw2004s/helpdata/en/03/0048413e466e24e10000000a155106/content.htm
    Main Topic Page:
    http://sdn.sap.com/irj/sdn/nw-wdabap#section2
    Tutorials for Beginners:
    Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
    eLearning Videos:
    /people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos
    refer this documentation for beginners:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/7c/3545415ea6f523e10000000a155106/frameset.htm
    hv a luk at this useful link  as well :
    https://www.sdn.sap.com/irj/sdn/nw-ui?rid=/webcontent/uuid/fed073e5-0901-0010-4eb4-c9882aac7b11 [original link is broken]
    regards,
    amit

  • New book about virtualization and SAP systems

    Hi guys,
    for all of you this may be of interest: there is a new book available, which contains a lot of stuff about virtualization. It is not only VMware, but also Hyper-V, Xen and Sun Solaris Zones. Unfortunately the book is only available in german.
    It contains a good overview about each solution and how to use the virtualization solution for your SAP environment.
    The book can be ordered on amazon, bol etc.
    Regards
    André

    The book is good for beginners to help making a vendor decision and for intermediate users as an installation guide.
    It basically walks the reader through the installation of VMware vSphere, Microsoft Hyper-V, SLES with Xen and Sun Solaris-Zones.
    I personally would have preferred to see a little bit more about optimization, but it is definitely a good first release.
    One word of warning: I ordered the book directly from SAP Press Germany and even though I got charged $25 for shipping it didn't arrive in prime condition. In fact all corners were bumped and there was also a minor cut across the side of the book. This seems to be caused by using a box for shipping that barely fits the book.
    Regardless of the shipping experience I recommend the book if you can read German.
    Cheers,
    Jens

  • 2006 controller and 1020 AP's

    I cannot get a 2006 controller to talk with 1020 AP's. I can get my 1240's to talk no problem, however the 1020's don't want to cooperate.
    I haven't changed the configuration on the controller, and I am using the same switchports.
    Thoughts?

    can somebody explain this a little more in detail where exactly should i put those special strings? on DHCP server? or DNS server?
    i am also confused with those DHCP servers..
    my example:
    i have VLAN1 for management with DHCP server 172.16.1.5 for that subnet. All APs should get addresses from that pool.
    then i have VLAN20 for traffic with other DHCP 192.168.1.5 for that subnet. All clients should get addresses from that pool.
    i linked management and AP-management interfaces on physical port 1.
    i created dynamic interface "traffic" for VLAN20 and linked it to physical port 2.
    my questions are:
    1. while configuring WLC management interface which address should i use for DHCP server?
    2. same question for configuring AP-management interface
    3. is there any less complicated tutorial on the net for step-by-step configuring 2006 WLC and 1020 APs on the net? (some of us are still real beginners).
    any help will be more than welcomed

  • KeyListener..for beginners..please help me

    hi, im new to java..i think that this thing is simple to you guys..im trying to make a program where there is a ball bouncing around the screen..theres 3 walls one on the left one on the right and the other on top..there should be a moving catcher at the bottom..which should be controlled by the keyboard..
    i already made the catcher..my only problem is..i dont know how to make it move..
    by the way..i'm using threading..
    it would be nice if you can post even a simple example of threading with keylistener even just left and right so i would know how to apply it..
    i hope that someone there would help beginners like me, it would really be a big help..
    thank you very much!
    -dennis

    Hi Madhuama, I'll try to give you a hand with this. First off, what OS is running on your notebook, what game are you attempting to play, and how is it not working? Is it not installing?
    Thanks,
    Fenian Frank
    I work on behalf of HP

  • Need help or documentation for beginners with SAP BI7

    I am relatively new to SAP (less than a year) and I am still having difficulties understanding the basics about SAP.  I write queries and reports and would appreciate any links or books that would help guide me.  I have bought a book through SAP Press but I need a SAP for beginners books that is really easy to understand.
    Thanks

    Hi......
    Check this link :
    http://www.youtube.com/watch?v=nWsvV6Z64yw&feature=related
    Also you will get everything in SAP Library : help.sap.com
    Regards,
    Debjani..........

  • Beginners question, just started out! please help!

    I am currently doing a tutorial on how to design a high-detailed plastic navigation bar via link: http://www.tutorialpark.com/high-detailed-plastic-navigation-bar/
    I am currently stuck on step 3 (i know! pure beginner!) it says:
    Let’s add some shades for the navigation menu foundation. Create a New Layer; send backwards, Ctrl+Click on the Shape Layer, fill selection with color (#86a6b5). Deselect and apply Gaussian Blur (1.8px), then Motion Blur (90deg, 41px). Now apply Gaussian Blur (1.8px) one more time. Set opacity 85%.
    1. Send backwards... means make sure layer is below the previous one?
    2. Ctrl+Click on the shape layer, fill with selection with color... So i have the new layer highlighted, i ctrl+click on the shape layer... Now what?
    If anyone can answer these it would be really appreciated
    Thank you

    1. Yes.
    2. Ctrl-clicking a layer causes a selection to be made from the grayscale levels in the layer you clicked on.  I assume from the way it's written that the instructions want you to do an Edit - Fill on your new layer.
    Certainly those instructions are written rather tersely, probably with experts in mind.
    Hope this helps!
    -Noel

  • Beginners Help

    Hi All,
    I am learning J2EE technology. Please suggest me any book which gives complete procedures like packaging an application in war, ear format, deploying applications, web applications directory structure and other details on various application servers like weblogic, websphere.
    It would be a great help.
    Thanks in advance.
    Maurya

    Refer to
    http://edocs.bea.com/wls/docs70/programming/packaging.html

  • Help on beginners easy RX/TX problem (Send/Receive bits)

    Hello!
    Im really new to Labview. My problem is quite simple. I want to transmit a given bitstream from file via bpsk. At the other side i want to receive all the time data, demodulate and save it to a file. I dont want to do any packet format or whatever, simply transmit the stream and all the time receive on the other side, because the later steps i want to do in my already given algorithm.
    I cant open somehow most of the example from USRP. I also dont need any GUI. Can someome help me how that is done?

    Hello Hanzzz,
    The easiest way to begin will be using the examples that come with the USRP. 
    Go to Start >> All Programs >> National Instruments >> NI USRP >> Examples.
    Open the ModulationToolkitExamples folder
    Double click on the niUSRP EX PSK Tx example VI
    On the block diagram, change PN Sequence to Read from file
    Create a constant for the Path input terminal
    Switch to the front panel and choose the correct PSK format you would like and the file you would like to read from
    You can use the niUSRP EX PSK Rx example VI to receive the signal and save the output bitstream from the MT Demodulate PSK VI to a file.
    Take a look at the LabVIEW example on how to write to files
    From LabVIEW, click the Help menu
    Click Find Examples
    In the Browse tab, click on the Fundamentals folder then click on the File Input and Output folder. I would suggest either the Write to Text file or Write Binary file examples.
    Anthony F.
    Product Marketing Engineer
    National Instruments

Maybe you are looking for

  • HT204053 my apple id is not an email address

    When I try to log in to iCloud, it asks for my Apple ID and password.  My apple ID was set long before an email address was required as an id.  Therefore, I cannot log on to iCloud.  Is there a fix for this?  If I set up a new Apple ID, then I have t

  • Usage Tracking Catalog Problem

    I am trying to setup usage tracking in OBIEE running on Windows 2008. Every time I try to open the sample catalog I receive the following error: Error initializing/loading existing Catalog: D:\UsageStatistics\UsageTracking. I have tried the file from

  • How to know which row is newly created in the table

    Hi all i have one classic table with a button to add new row. when page renders initially it displays some record .Here user can either update the previously existing record or may create new ones . after adding one more row when users submits it , i

  • Retrive document path from R/3 system

    I'm trying to retrive the document path (FILEP) from DRAW table in r/3 system to be displayed in my report i'm using remote cube and all other column are displayed perfectlt but when i choose this (FILEP) I'm getting the following error. <b>Error val

  • Applications that are being downloaded are not visible in the home

    Hello,help me,when I want to download an application, the application was not seen at home, but should be visible,when finished downloading the new look, does it bother me