Not Yet Answered # curved edge

wildgoose 420 VernonDozier 2,218 Discussion Starter aveek wildgoose 420 wildgoose 420 Discussion Starter aveek VernonDozier 2,218 OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...

0

You're talking about a spline!

Will there only ever be three points or merely looking at the current three points in an array of points.

Do you want the curve to pass through the points or use them as a guide for placing a smooth curve!

If you're on the curve then that means that they all have the same radius from the center of a circle right? Draw 3 points on a piece of paper. Take a compass draw some intersecting curves. Do you see your answer?

Now think ellipse.

Circumference of a circle is 2 PI r = PI (r + r)

Or think of r as x, so PI (x + x ) since x = y on a graph.

Circumference of an elipse is PI (x + y)

0

im trying to draw a curved line using mouse. there are three points on a straight line. a starting point, an ending point and a point in between. i want to draw a curved line by dragging the middle point in any direction. the other two points remain constant.

Three points can produce all sorts of different curves, not just one. What kind of curve are you talking about? A Bezier curve?

0

could you please elaborate. or give an example. i want the curve to pass through the three points. the three points may not be place equidistant from the center. two could be right next to each other

0

What kind of curve! As Vernon Dozier indicates.

For example, if the moving point is between the two center points on a curve. Put it between them. Now move tangent to the line between the two end points. It's a circle, but if you get further the 1/2 the distance between the two points your circle flips. Instead of being between the two points on the acute angle formed by those two points and the circle midpoint of the circle. You are now on the obtuse side of the angle.

This is only one type of curve. There are others!

0

Since you want any curve. Try working with what I just posted. Forget curve for now, think on full circule. change to an arc later once it works.

The one thing in common with what I posted is there is one center point, and all three points have the same radius from that point!

0

i have attached a picture of how the curve should look like. the three points are shown

0

i want any kind of curve which will contain the three points

[ATTACH]10803[/ATTACH]

i have attached a picture of how the curve should look like. the three points are shown

It may be a Bezier, I'm not sure. Being as this is the Java forum, Java has a tailor-made Bezier-Curve option, so go with what's already there. Here's an applet I made.

http://www.derekscswebsite.com/MathStuff/BezierCurve/index.html

You're looking at using a GeneralPath, using curveTo, I would imagine. Three points will make your curve, so curveTo expects six doubles/floats (two doubles/floats per point).

http://java.sun.com/javase/6/docs/api/java/awt/geom/GeneralPath.html

http://java.sun.com/javase/6/docs/api/java/awt/geom/Path2D.Float.html#curveTo(double,%20double,%20double,%20double,%20double,%20double)

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

I don’t want at this stage work on a big separate project as I've already got plenty ...

Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.

btn_addline :

`Private Sub btn_addline_Click(ByVal ...`