answersLogoWhite

0


Best Answer

There will a part like this:

typedef struct Point { double x, y; } Point;

typedef struct LineSegment { Point from, to; } LineSegment;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a c program that define a structure linesegment that will represent a line segment by the co-ordinate of its endpoint?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Define socket in java?

The Socket class in Java is an endpoint in a standard TCP connection. The Socket class implements methods which take care of all the overhead required with TCP communication.


Difference bw linear and nonlinear data structure?

A data strucutre is classified into two categories: Linear and Non-Linear data strcutures. A data structure is said to be linear if the elements form a sequence, for example Array, Linked list, queue etc. Elements in a nonlinear data structure do not form a sequence, for example Tree, Hash tree, Binary tree,etc. There are two ways of represneting linear data strucutresin memory.One way is to have the linear relationship betweent he elements by means of sequential memory locations. Such linear strucutres are called arrays. The other way is to have the linear relationship betweent he elements represnted by means of links.Such linear data strucutres are callled linked list.


Which OSI layer does error handling take place?

The data link layer (2nd layer), the network layer (3rd layer) and the transport layer (4th layer) each handle their own specific errors, which should prevent errors in both directions. Any untrapped errors will result in a corrupt transmission which may or may not be handled by the appropriate endpoint, dependant upon the protocol.


How is a line different from a line segment?

A line is basically a combination of two joined rays pointing in opposite directions. A line has no endpoints and a line segment has two. <--------------> line ---------------> or <------------ ray .________. line segment (It's supposed to be a line with dots at the end to signify endpoint)


10 situations that can be represented by means of graph?

Financial history Score history Statistical analysis data set averages data set trends time value of money usage statistics performance statistics personal achievement trends grade history and analysis

Related questions

How do you find an endpoint if you are given one endpoint and the midpoint?

If you are only given one endpoint and a midpoint, you know what the middle of the line segment is. Since the midpoint is half of what the line segment's length is, all you have to do is find the distance between the endpoint given and the midpoint, then add that coordinate to your midpoint and get your other endpoint. For example: Endpoint A: (4,5) Midpoint: (6,8) Distance between: (2,3) Add (2,3) to (6,8) and get Endpoint B: (8,11).


What name is part of a line that has one endpoint?

A line with only one endpoint is a ray. One end has a point, and the other has an arrow to represent how the line continues forever.-------------------------->


Givin the coordinate of one endpoint of segment AB and its midpoint find the coordniates of the other endpoint?

If the coordinate of A is x, and that of the midpoint of AB, M, is m then the distance AM is m-x so the distance AB = 2*(m-x) So the coordinate of B is x + 2*(m-x) = 2m-x For coordinates in more than one dimension, apply the above rule separately for each dimension.


How do you find the missing endpoint of a segment with an endpoint and a midpoint?

The direction of missing endpoint is the same as the direction from the known end point to the midpoint. The distance from the midpoint to the missing endpoint is the same as the distance from the known end point to the midpoint. In coordinate geometry it is simple. If the known end point is (p, q) and the mid point is (r, s) then the missing point is (2r - p, 2s - q).


Which method could you use to calculate the y-coordinate of the midpoint of a vertical line segment with endpoint at 0 0 and 0 15?

Each coordinate of the midpoint of a straight line segment is the arithmetic mean of the coordinates of the endpoints. So the y-coordinate is (0+15)/2 = 7.5


How do you find the endpoint of an endpoint?

The endpoint has no dimension. It has no endpoint.


How could you find the y-coordinate of the midpoint of a vertical line segment with endpoint at (00) and (015)?

If you mean endpoints of (0, 0) and (0, 15) then the midpoint is at (0, 7.5)


How do you find the midpoint given the endpoints?

It is really simple. A follow the steps below: 1) Add up your X1 AND X2 from both endpoints and divide by two. This will be your X coordinate for the midpoint. 2) Add up your Y1 + Y2. Divide it by two. This will be your Y coordinate for the endpoint. Hope this helps :)


Does a line have an endpoint?

No, lines are ongoing, and have no endpoint.


What is the other endpoint of the line segment with the given endpoint and midpoint. Endpoint (6-9) midpoint (76)?

If you mean endpoint (6, 9) and midpoint (7, 6) then the other endpoint is (8, 3)


How do you find the endpoint of a line segment?

Use the midpoint formula.( x1 + x2 / 2 , y1 + y2 / 2 )For example, if you were given segment QR with midpoint M(-1, -1) and endpoint Q(-8, 10):(-1, -1) = ( x1 + -8 / 2 , y1 + 3 / 2)X COORDINATE--------------------1 = x1 + -8 / 2-2 = x1 - 86 = xY COORDINATE--------------------1 = y1 + 10 / 2-2 = y1 + 10-12 = y


What is a line that share a common endpoint?

The answer depends on what the endpoint is shared with!