In mathematics, a curve (also called a curved line in older texts) is, generally speaking, an object similar to a line but which is not required to be straight.
Questions tagged [curve]
1306 questions
19
votes
2 answers
Find bezier control-points for curve passing through N points
Considering the following nice solution for finding cubic Bézier control points for a curve passing through 4 points:
How to find control points for a BezierSegment given Start, End, and 2 Intersection Pts in C# - AKA Cubic Bezier 4-point…

jwin68
- 191
- 1
- 1
- 4
18
votes
1 answer
How to plot individual points without curve in python?
I want to plot individual data points with error bars on a plot, but I don't want to have the curve. How can I do this? Are there some 'invisible' line style or can I set the line style colourless (but the marker still has to be visible)?
So this is…

Physicist
- 2,848
- 8
- 33
- 62
18
votes
2 answers
How to place the intercept of x and y axes at (0 , 0) and extend the x and y axes to the edge of the plot
Suppose I want to plot x^2. I can use curve() as follows.
curve(x^2, -5, 5)
However, I would like the axes to go through (0, 0). I could do something as follows:
curve(x^2, -5, 5, axes=FALSE)
axis(1, pos=0)
axis(2,…

Alex
- 4,030
- 8
- 40
- 62
16
votes
2 answers
Gradient Stroke Along Curve in Canvas
I'm trying to draw a curve in canvas with a linear gradient stoke style along the curve, as in this image. On that page there is a linked svg file that gives instructions on how to accomplish the effect in svg. Maybe a similar method would be…

user3705053
- 163
- 1
- 4
15
votes
5 answers
How do I know if a Lat,Lng point is contained within a circle?
Ok pretty self explanatory. I'm using google maps and I'm trying to find out if a lat,long point is within a circle of radius say x (x is chosen by the user).
Bounding box will not work for this. I have already tried using the following…

Stuart Beard
- 180
- 1
- 2
- 12
14
votes
1 answer
How to create a curved SVG path between two points?
I need to draw a symmetrically curved line between the centers of two circles.
13
votes
1 answer
JavaFX line/curve with arrow head
I'm creating a graph in JavaFX which is supposed to be connected by directed edges. Best would be a bicubic curve. Does anyone know how to do add the arrow heads?
The arrow heads should of course be rotated depending on the end of the curve.
Here's…

Roland
- 18,114
- 12
- 62
- 93
13
votes
2 answers
Closing a contour curve in OpenCV
I'm using OpenCV (Canny + findCountours) to find external contours of objects. The curve drawn is typically almost, but not entirely, closed. I'd like to close it - to find the region it bounds.
How do I do this?
Things considered:
Dilation - the…

SRobertJames
- 8,210
- 14
- 60
- 107
13
votes
2 answers
n-th order Bezier Curves?
I've managed to implement quadratic and cubic Bezier curves.They are pretty straightforward since we have a formula. Now I want to represent an n-th order Bezier curve using the generalization:
Where
and
I'm using a bitmap library to render the…

Jonas
- 1,019
- 4
- 20
- 33
13
votes
6 answers
How to find out Y coordinate of specific point in bezier curve in canvas?
I need to find out Y coordinate of specific point of bezier curve in canvas. Do you know, how to find it out? Thank you

Jan Kožušník
- 683
- 3
- 16
- 30
13
votes
5 answers
Finding Y given X on a Cubic Bezier Curve?
I need a method that allows me to find the Y-coordinate on a Cubic Bezier Curve, given an x-coordinate.
I've come across lots of places telling me to treat it as a cubic function then attempt to find the roots, which I understand. HOWEVER the…

Captain Awesome
- 141
- 1
- 4
12
votes
6 answers
Two-color Path object
The following image illustrates what I am trying to achieve:
Basically I want to create two Path objects that "touch" each other (parallel paths). This is XAML used to generate this image:
…

Paya
- 5,124
- 4
- 45
- 71
12
votes
1 answer
How to draw a smooth curve passing through some points
I have
plot(rnorm(120), rnorm(120), col="darkblue", pch=16, xlim=c(-3,3), ylim=c(-4,4))
points(rnorm(120,-1,1), rnorm(120,2,1), col="darkred", pch=16)
points(c(-1,-1.5,-3), c(4,2,0), pch=3, cex=3)
I want to delineate a part of a graph, by drawing a…

ECII
- 10,297
- 18
- 80
- 121
12
votes
2 answers
Interpolating a path/curve within R
Within R, I want to interpolate an arbitrary path with constant distance
between interpolated points.
The test-data looks like that:
require("rgdal", quietly = TRUE)
require("ggplot2", quietly = TRUE)
r <- readOGR(".", "line", verbose =…

michelk
- 163
- 1
- 6
11
votes
7 answers
How to calculate the nearest point of a line and curve? .. or curve and curve?
Given the points of a line and a quadratic bezier curve, how do you calculate their nearest point?

Robin Rodricks
- 110,798
- 141
- 398
- 607