Map Coordinates Of 4 Triangles In A Square To 4 Triangles In A Triangle?
Feb 22, 2010
Given the image below
1. I have updated the image based on feedback from Steven_W so there are 4 triangles in the right hand diagram instead of 3 which makes more sense!
2. update image again to label sub triangles as A, B, C, D in grey
What is the pseudo algorithm for mapping a coordinate (x,y) in the left hand square such that a coordinate (u,v) is produced within the rectangle bounding the triangle on the right so that points are interpolated between the mapping points as illustrated on the diagram? 1 to 4 are equidistant on the triangle from left to right even though my illustration is a bit rough around the edges :)This is to generate a rough and ready panel for the lid of a skybox from the top half a 360 degree panoramic photo.
update 3 based on feedback.The first step appears to be working out which triangle we are in for the left hand diagram based on the (x,y) coordinates.The second steep is to work out the distance along the vertices of that triangle. Then use those distances to get the coordinates on the related triangle in the diagram on the right
update 4 - code to identify triangle in left hand diagram
Public Function TriangleIndex(ByVal x As Integer, ByVal y As Integer, ByVal w as integer, ByVal h as integer) as integer[code].....
I am trying to code some Triangles. But I am getting a not declared error and I am stuck a bit. FYI I have to use OutputTextBox.AppendText in my program.
'First Triangle For i As Integer = 1 To 10 outputTextBox.AppendText("*")
After exporting data using a third party component the data in the excel sheet isn't type correctly. Excel thinks that some values are string while they are numbers and a little green triangle shows up.
We've coded the following to fix this:
For Each objCell As Microsoft.Office.Interop.Excel.Range In objWorkSheetReport.Range(objWorkSheetReport.Cells(1, 1), objWorkSheetReport.Cells(Me.RowCount + 10, Columns.Count + 10)).Cells
[Code].....
This removes all those little green triangles but is really slow.
Is there a faster way to convert a Range of data quickly so the green triangles don't show up?
Public Class form1 Private Sub btnAnswer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAnswer.Click[code]........
how can i make vb realize that the side that is opposite of the given angle, has to be less than the other sides. Also im not sure what Acamar meant by If txtAngleA.Text <> "" AndAlso txtAngleB.Text <> "" AndAlso txtSideA.Text <> "" Then 'two angles and a side Because im not sure what <> does.
I am trying to build a coordinates system but am having trouble with how to.. What I have sofar is a textbox that allows the user to enter a length. This length is user defined but never smaller then 610 in length since this is the minimum unit size we use to build timber frames. The overall length of a timber frame is infinite (well not really, but it is for what I want) the timber frame has beams every 610mm set apart from each other (this is a legal requirement) so I want my vb.net to set coordinates for each beam at intervals of 610 then write that coordinates system to a text based *.SCR file
I want to translate MouseArgEvent.Location (x,y) coordinates into my custom graph coordinates. Mouse Y coordinates increase from top to bottom while my grid's y value increase from bottom to top. Given my following code, I would need to create 21,500 separate conditional expression for 100(y) x 215(x) possible coordinate locations for my grid.
Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs) If e.X > 48 AndAlso e.X < 50 AndAlso e.Y > 397 AndAlso e.Y < 399 Then MessageBox.Show("about 0,0")
Develop a Company Logo application that allows users to draw shapes. The application should provide the user with RadioButtons to allow the selection of the next shape to be drawn. TextBoxes should be provided to allow the user to enter coordinates (X and Y coordinates) of the shape, the width and the height of the shapes. Users should also be able to change the shape�s colour.my question is how to allow the user to enter coordinates (X and Y coordinates) of the shape, the width and the height of the shapes and change the shape�s color from combo box. pro help
below is my code:
Public Class Form1 Dim mycolor As Color Dim mypen As Pen Dim mygraphics As Graphics
I'm creating a movable scenary with, like 100 different flights. I want to create for every type of flight a triangle...so it's moves around and you have an idea how the airspace looksq like at what moment.Now my question is, what's the best way to draw these rectangles? I created a class 'Flight' and it has a Graphicspath in it. Now I want to update the triangle, which represents the aircraft, with the speed and heading...so it moves around well.
Dim blackPen As New Pen(Color.Black, 3) Dim ptsArray As PointF() = {New PointF(100.0F, 120.0F), New PointF(70.0F, 60.0F), _ New PointF(40.0F, 120.0F), New PointF(100.0F, 120.0F)} e.Graphics.DrawLines(blackPen, ptsArray)
I have the outline of a triangle right where I want it. I need to fill it so it's a solid color. Can anyone give me a start on filling it? (Using VB.NET 2008)
Currently working on a 2D engine, not for gaming but for design software / visualisation for machines. So far it is comming along quite fine. I started to wonder if it were possible to draw a triangle and fill it with some form of a a texture, or even better a polygon and fill that with a texture.
I know that DX can do that for me :P but I am realy focussing on GDI+ at the moment.
I am taking an Intro to VB class in college and for on of our assignments we need to make several shapes with *'s. The user is prompted by an input box where they decide how large to make the shapes. The only one that I am struggling with is the inverted triangle. Here is what it should look like if the user would select to have 5 rows.
* * * * * * * * * * * * * * *
Here is the code that I have written for the REGULAR triangle.
Private Sub btnTriangle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTriangle.Click Dim numstars As Integer
i was asked to do a program which can find if a 2d point is inside a triangle or not, only the 3 points of the triangle were given. i planned to do this using the slopes of the 3 sides, then with y-y1=m(x-x1) using the other vertex and the point being checked see if the slope was the same sign and on the same side of the line. if this was true for all 3 then the point is inside the triangle the problem is i cant think of a logical expression for the if/then/else structure to show this anyone know what i should use or should i just go down a completely different route?
I have a menu strip on a form and to assist the users and to make it more aesthetically pleasing I want to add an inverted triangle at the end of each menu title to make it more obvious there are other options available if you click on it.I am currently using Times New Roman as a font but that can be changed if necessary.
I'm working on a Pythagorean Theorem program that calculates the sides and angles of a right triangle. I have the side measurements and all that down, but I can't find the Visual Basic function that will allow me to calculate the angles from the side measurements. I've tried asin and sinh, but both give me the wrong measure.
Here is the code: Public Structure Triangle Shared a As Double = 1 Shared b As Double = 1 Shared c As Double = Triangle.FindC Public angleABC As Double [Code] .....
I am receiving an error in the function. "Triangle.angleABC" is generating :"Reference to a non-shared member requires an object reference". I need to find the hypotenuse for this Triangle. I have tried setting the variable as an object, this does nothing for the error. Also I've tried to use Public in the function and I receive an error stating it needs to be shared. I would like to work the the Structure with out running any functions on it first.
I need to create an application that creates Pascal's triangle the user would enter the number of rows, and using the formula (which i do not know... :/) would create the triangle. For example: the user enters 5 rows triangle:
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
as you can see the numbers are created by adding the 2 numbers above it starting with 1 at the top
I have a Form with a StatusStrip Component docked at the bottom.The form has fixed width and is not resizable.However the StatusStrip has a little 'resize triangle' at the right. (6 little dots)This gives the impression that the window is resizable.