473,465 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Please Help! Simple Vb Problem!

2 New Member
I have never created my own program before (I'm in college right now), and I have to create a program for the length c on any triangle using sides a, b, and theta angle c. Here is what I have so far (however wrong it may be!).

Function C(A, B, theta)
C = (A ^ 2 + B ^ 2 - 2 * A * B * theta) ^ (1 / 2)
theta = Acos * (180 / Pi)
Pi = 4 * Acos

End Function

It doesn't have to be complex. I just have to get it to work on a triangle. There are no other requirements. Thanks for your time!
Oct 10 '06 #1
1 1346
albertw
267 Contributor
I have never created my own program before (I'm in college right now), and I have to create a program for the length c on any triangle using sides a, b, and theta angle c. Here is what I have so far (however wrong it may be!).

Function C(A, B, theta)
C = (A ^ 2 + B ^ 2 - 2 * A * B * theta) ^ (1 / 2)
theta = Acos * (180 / Pi)
Pi = 4 * Acos

End Function

It doesn't have to be complex. I just have to get it to work on a triangle. There are no other requirements. Thanks for your time!
first of all when you want to create a function your should start with e.g:

private function c (a,b,theta) as long
meaning:
function c
variables to come with the function are a,b, and theta
you should call this function with Answer=c(1,2,3)

aCos does not exist in VB, you should use Atn
Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
look for 'Derived Math Functions' in VB-help

^(1/2) won't work, use Sqr instead.
C = (A ^ 2 + B ^ 2 - 2 * A * B * theta) ^ (1 / 2)
c=sqr(a*a + b*b - 2*a*b*theta)

remember that VB works in radians rather than degrees.

e.g:
Answer=C(2,3,0.45)

Function C(A, B, theta)
C =SQR (A *A + B *B - 2 * A * B * theta)
End Function

Answer=2.7568......
Oct 20 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql,...
2
by: m3ckon | last post by:
Hi there, had to rush some sql and am now going back to it due to a slow db performance. I have a db for sales leads and have created 3 views based on the data I need to produce. However one...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
1
by: Steve | last post by:
Hi, I've asked this question a couple of times before on this forum but no one seems to be nice enough to point me to the right direction or help me out with any information, if possible. Please...
2
by: tuan_vandyk | last post by:
Hi I desperately need help with my project. Theoretically everything should work bu it just isn't. Please email me for a copy of the project's source code. It was made in Turbo C++ 5. Please if...
17
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
0
by: 2Barter.net | last post by:
newsmail@reuters.uk.ed10.net Fwd: Money for New Orleans, AL & GA Inbox Reply Reply to all Forward Print Add 2Barter.net to Contacts list Delete this message Report phishing Show original
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
5
by: tabani | last post by:
I wrote the program and its not giving me correct answer can any one help me with that please and specify my mistake please it will be highly appreciable... The error arrives from option 'a' it asks...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.