[2008] Finding Distance Between Unevenly Spaced Units?
Jan 23, 2009
I'm trying to write a little program to help me find the distance (in feet/inches) between the frames of a ship. This would be fairly easy, except the frames are unevenly spaced.Let's say this is a top view of a shape, and the frames are vertical lines that comprise the overall ship. (In ships, this is the shape of the hull.) Each number is a frame.
1 2 3 4 5 6 7 8 9 10 11 12 13
In this example, there are 1 units between frames 1-3, two units between frames 3-6, three units between 6-9, four units between 9-11, and 1 unit between 11-13.So, what I want to do is post a program where the user inputs two frame numbers: so they would enter, for instance, a start location of 5 and an end location of 11. So, it would calculate the number of units between those two frames based on the limits. So, between 3-6 there are two units, so it would subtract the start location from the nearest limit (6).
6-5 = 1
Multiply by 2 units spacing per frame, so that's 2 units. Frames 6-9 are all included, so 9-6=3 x 3 units = 9 units. Since 9-11 are also all included, it would be 11 - 9 = 2 x 4 units = 8 units. Then the program would add that all together - 2 + 9 + 8 = 19 units total.
Now, for my instance, there are a few more complications (it's in inches, and large increments (i.e. 36" spacing), and there are 304 total frames split between the middle of the ship in two sections, fore and aft of the line), but really I'm just trying to get a handle on how to impose these limits and calculate the distance. Attached is the proposed layout for my program (ignore the 20'5", that's just how I want the output to look).
View 2 Replies
ADVERTISEMENT
Jan 28, 2010
Our VB.NET project is using a Java library from Vivid Solutoins [URL}... to do Geometry calculations.[URL}...
What I can't figure out are the units specifically for the Buffer property, or any other distance for that matter. My program is dealing with Nautical Miles, and the documentation gives no indication if the units are degrees, miles, Nautical Miles, Kilometers, inches, etc.
View 2 Replies
Dec 17, 2010
You could check to see if the distance across the form minus the distance across the picture box is equal to the horizontal location of the picture box to see if it's on the right side. For the left side, just check if the horizontal location of the picture box is 0.
View 2 Replies
Feb 22, 2012
So i decided to make a units converter for my term's project and my teacher insisted on including the combo box in this project. I'm not really familiar with the combo box as i am still a beginner in visual basic. I've looked around and learned a bit about using the combo box but later i faced a problem. First i created a Main combo box and placed it in the middle of the form. I managed to use the select case command to make other combo boxes appear and disappear as i wish. I don't really know how to describe the problem, i want to make it that if i choose the input as a unit and the output is any other unit from two different combo boxes, the value in the input text box would be multiplied by a certain conversion factor and the result will be shown in the output text box.
View 1 Replies
Apr 22, 2012
I have a problem drawing dotted path lines, with evenly spaced dots: I want to be able to draw evenly spaced dots along a path line using points in an array, My issue is not with drawing the path line, with dotted lines, this is easy, but with the spacing of the dots at the start and end of the path line.
In the example I have created, I create a square with 4 points and draw a dotted path.The path starts at the top left corner and finishes back at the top left corner, the dots are evenly placed along the path, except the final dots at the end of the path. (Sometimes the dots are even and other times they are not even).The shapes I want to draw can be any size and any shape, but I have used a square in this example to show the problem I have.I have also attached two pictures showing the dotted path line, 1 with even spaced dots at the start / End and another showing the problem I want to resolve, with not evenly spaced dots at the start / end.The only difference between the two is the point values.
View 1 Replies
Mar 30, 2012
assuming i have an isoceles triangle, where i know the height + base width, how
can i calculate the width of that triangle at 1/3 of the distance from the point + 2/3 of the distance from the point?
i thought it'd be simply 1/3 base width + 2/3 base width, but my drawing is +/- a few pixels when i resize it?
View 4 Replies
Mar 1, 2009
I'm going to start delving into maths in vb Now want I want to do is convert the distance between two coordinates. I've found this linke below on the web. Does anyone have a link to good tutorial for this conversion?
View 7 Replies
May 21, 2011
I am trying to go through a datatable and sort records that fall within a certain criteria, one being distance.I have a function that will get the distance between two points based on Lon/Lat and my records in table have Lon/Lat Values
exisitng code
Dim dtrow As DataRow
Dim lat As Double = CDbl(34.213209)
Dim lon As Double = CDbl(-118.629276)
[code]....
I can I now use the function to filter records in table that are with a certain distance?
View 9 Replies
Apr 24, 2010
I am attempting to write a speed/distance calculator using visual basic 2008 express edition. I have gotten the program to do most everything I need but am having some difficulties and have been trying to fix them for 2 or 3 days now without any success. Will somebody, anybody please tell me how to fix the problems.The calculator should display the distance traveled when the speed and time are entered. This is the only major requirement. However, It needs to have all info input via a list box with popup windows displayed for speed entry and then again for time entry. I would like a label outside of the list box to show "Total Distance Traveled" and I would like the list box to display the following information
[Code]...
View 3 Replies
Sep 22, 2011
So i decided to make a units converter for my term's project and my teacher insisted on including the combo box in this project. I'm not really familiar with the combo box as i am still a beginner in visual basic. I've looked around and learned a bit about using the combo box but later i faced a problem. First i created a Main combo box and placed it in the middle of the form. I managed to use the select case command to make other combo boxes appear and disappear as i wish. I don't really know how to describe the problem, i want to make it that if i choose the input as a unit and the output is any other unit from two different combo boxes, the value in the input text box would be multiplied by a certain conversion factor and the result will be shown in the output text box
View 7 Replies
Jan 24, 2010
ive got to create a BMI calculator using metric units, when i enter my data, it doesnt work (i put in 1.5m and 90kg but the answer comes out at 3, and in clearly not anorexic heres what ive got at the moment
Dim BMIResults As New frmBMIResults
Dim Answer As Integer
Dim BMIAnswer As Integer
Answer = CType(tbHeight.Text, Integer) * 2
BMIAnswer = CType(tbWeight.Text, Integer) Mod Answer
'BMIResults.Show()
'Me.Hide()
View 3 Replies
Sep 13, 2010
the units measured by InputFile.PostedFile.ContentLength . I need to make sure the file is less than 500k.
View 2 Replies
Dec 16, 2009
I have original dataTable as [code].....
But I want to edit this table so as when Project P1 recieves some Units then in the next entry of Project P1 the Units ( Actual) Should be equal to Units (Actual) - Units Recieved. after editing the datatable it should be something like this [code].....
View 1 Replies
Mar 27, 2011
The program I am making requires the user to select what units he will be using. But it has to be able to convert his entered units and display them in the text boxes at all times during run-time. It works fine the first time the user switches units, but the second time the units are switched all the values in the text boxes go to 0... Ok Button
[code]...
View 5 Replies
Oct 25, 2011
im trying to create a program that will convert between metric and standard units.I chose length as my measurement so i have nanometer,millimeter,centimeter,meter,hectometer,kilometer,inc,feet,yard and mile.i wanted the input to be
- number to be converted(text box)
-unit number is in(combo box)
-unit to convert to(combo box)
i know how to do combo boxes,buttons and labels and stuff.The output is the converted number this is what i have so far but its soooo wrong?
Public Class Form1
Private Sub Convert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Convert.Click
Dim Inch, Feet, Yard, Mile As Integer
Dim Nanometer, Millimeter, Centimeter, Meter, Hectometer, Kilometer As Double
[code]....
View 1 Replies
Oct 16, 2010
I'm trying to place multiple units that have already been selected on a previous form to appear where selected on the battlefield. I have tried it multiple ways and all I can do is get one to appear not the econd ect.
[Code]...
View 1 Replies
Jan 19, 2010
Is there any way so that i can set the measurement unit of a form from Pixels to Twips?
View 5 Replies
Oct 2, 2011
I have a DataSet with a DataTable that has several numeric columns of Data. The numeric data is composed of distances given in U.S. Standard units. I currently have my ComboBoxes set up and working, but I need to expand on what I currently have in two ways.I need to be able to convert the Decimal numbers in my data column being displayed to Fractions, is there a way to do this and maintain databinding? In this case its the Display Member of the data source...I need to be able to display my drop down options in different sets of units... I've written Unit Conversion classes to help take care of this, but I don't know if I can somehow do this as well and maintain databinding? I'd like to convert the units on the display members as well...
Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectionChangeCommitted
Select Case ComboBox1.SelectedItem
[code]....
What is the best approach for using ComboBoxes when dealing with issues such as displaying fractions and units...
View 1 Replies
Mar 19, 2009
What i got is a checkedlistbox with a list of text files, iam trying to search thru the text file and add to a listbox, my code works, But from 2 Txt files its returning 2 found and each txt file has 5 lines with excat names.
[Code]....
View 7 Replies
May 14, 2010
I have a problem that I�m sure will not be hard to fix for anyone who has been using CR for some time.
To start I have created a program in VB2008 that uses a MS Access data file, I can connect to it with no problem and can also add data and amend data, so all seems to work perfectly. I have published it and it once again runs perfectly on another/s machines.I have now a requirement for a number of reports so have chosen CR for this purpose. I have connected the report to the database and that runs with no problems at all, that is until I try to run it on another machine, it seems not to be able to find the database and comes up with a database Login panel wanting me to log in with a password and Admin name.
I feel it's properly a problem with the path to the database but if I modify the path manually it still won't work.
View 1 Replies
Sep 21, 2009
G:DevelopmentDOT NET DevColony_4ImagesBattenhallAve_Plan.bmpand i want to find and return the value after the last '' for example in the string above i would want to return:BattenhallAve_Plan.bmp
View 5 Replies
Jun 19, 2010
I have FolderBrowserDialog1, how do I find the last latter of FolderBrowserDialog1.SelectedPath?
View 1 Replies
Dec 4, 2010
I am attempting to calculate a range of prime numbers determined by two user inputs (textboxes) I have the following code, but it displays nothing but zeros in the multiline textbox. I just need a bit of guidance here as to what is causing my code to show nothing but zeros.
Public Class PrimeNumbers
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lowBound As Double
Dim upBound As Double
[code]....
View 3 Replies
Oct 15, 2009
I'm connected to an access database using VB 2008.. there is information already located in the tables. But what I am looking to do, is find the "SUM" of all the data in a certain column.
View 35 Replies
Jan 1, 2010
I'm trying to work out a bit of a memory leak and was hoping someone can assist. The below program is running fine except for one thing. 1. The memory leak. When I run the program and watch task manager, I can see the memory usage of the program starts at roughly 14 meg. Over a period of hours, that increases pretty substantially. Eg. at 6am this morning, it was at 14 meg, and by 3pm it was at 36 meg.In a nutshell this program takes an incoming stream of data which looks like this.
MSG,3,51,350,461D3B,1427,2007/02/24,10:58:35.441,2007/02/24,11:03:35.829,,33975,,,53.82440,10.19830,,,0,0,0,0
MSG,3,51,673,44CE6D,1429,2007/02/24,10:58:35.098,2007/02/24,11:03:35.829,,39000,,,53.87798,9.88422,,,0,0,0,0
MSG,3,51,350,461D3B,1427,2007/02/24,10:58:35.848,2007/02/24,11:03:36.829,,33975,,,53.82353,10.19696,,,0,0,0,0
It basically parses the stream and places items into hash tables depending on the type of data. Eg. I have a hash table for latitude, one for longitude, one for altitude, etc.The key is always the hex code eg. in the first line above the key would be 461D3B.Essentially, as the data arrives in and is parsed and placed into hash tables depending on the type of data, I also have another hash table dedicated to keeping track of timeout times for that individual piece of data. The timer event fires and if the timeout is exceeded for that piece of data then it gets removed from all the hash tables.
I believe this is working. I've done heaps of debug output to the output window ensuring that items are being added to and removed from the hash tables successfully. Eg. ensuring that the hash table record count matches what I believe the number of active records should be.I'm at a loss what could be causing this memory leak though. I'm assuming i'm not disposing of an object properly, or not initializing/declaring it properly, but I can't work out what i'm doing wrong.One thing i'll mention though. The timer event occasionally comes up with a warning about the contents having changed during the For..Next loop. I don't think this will affect things though. As long as the hash table item count matches what it should be, I don't see that being an issue.
Imports nsoftware.IPWorks
Imports System.Data.SQLite
Public Class frmMain
[code]....
View 14 Replies
Mar 23, 2011
I am needing to locate a given set of numbers in a string, and have limited success, it is almost always finding the numbers that I want, but I need it to be more reliable.Below is a test program that I am using to test with and also 2 picures that may explain better that I can put into words.
[Code]...
View 6 Replies
Jul 27, 2009
I have a string. I need to check what characters it contains because certain invalid characters are causing my sql query not to work. In the query I select where SupplierName is equal to the string. I need to replace the invalid characters at database and vb level. But I need to know first what the characters are.
View 15 Replies
Mar 30, 2011
How can I calculate the bounding rectangle of an ellipse using 4 points on the ellipse?
View 1 Replies
May 23, 2009
I got a situation where i have the first word only of a a child window and the rest of the name changes. I need to find this child window using findwindowex i think by not knowing the full name.
Searching the processes wont work since it is a child.
View 6 Replies
Aug 29, 2009
Is there anyway I could find text in a RichTextBox? I want to put the code in here
[code]...
View 10 Replies