curve

Curved text in Java

我的未来我决定 提交于 2019-12-21 05:28:17
问题 I am looking for the simplest way to draw some text around an ellipse object on my app. I need to create a feeling of "cuddling". So far, I've used the Graphics2D class to print my drawings on screen and my "canvas" is a BufferedImage. The width and height of my ellipses are constant at 50,50 respectively. Any suggestions? 回答1: Here's an example of curved text: // slightly modified from the original: // http://examples.oreilly.com/9781565924840/examples/RollingText.java import javax.swing.*;

How to create a curved SVG path between two points?

六月ゝ 毕业季﹏ 提交于 2019-12-21 05:04:11
问题 I need to draw a symmetrically curved line between the centers of two circles . <svg> <circle class="spot" id="au" cx="1680" cy="700" r="0"></circle> <circle class="spot" id="sl" cx="1425" cy="525" r="0"></circle> <line id="line1" stroke-width="2" stroke="red"/> </svg> This is the code I wrote so far. < line > element should be replaced with a curved path . function drawNow() { let point1X = document.getElementById("au").getAttribute("cx"); let point1Y = document.getElementById("au")

n-th order Bezier Curves?

穿精又带淫゛_ 提交于 2019-12-21 03:37:26
问题 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 output, so here is my code: // binomialCoef(n, k) = (factorial(n) / (factorial(k) * factorial(n- k))) unsigned int binomialCoef(unsigned int n, const unsigned int k) { unsigned int r = 1; if(k > n) return 0; for(unsigned int d = 1; d <= k; d++) { r *=

iOS how to calculate number of pixels/area enclosed by a curve?

↘锁芯ラ 提交于 2019-12-20 12:46:15
问题 I got an arbitrary shaped curve, enclosing some area. I would like to approximate the number of pixels that the curve is enclosing on an iPhone/iPad screen. How can I do so? A curve is defined as a successive x/y coordinates of points. A curve is closed. A curve is drawn by a user's touches (touchesMoved method), and I have no knowledge of what it looks like I was thinking of somehow filling the closed curve with color, then calculating the number of pixels of this color in a screenshot of a

How to reduce the number of points in a curve while preserving its overall shape?

浪尽此生 提交于 2019-12-20 11:36:13
问题 I have a list of points that make a curve, and I would like to reduce the number of points, but still keep the overall shape of the curve. Basically, I want to go from this: To this: So the algorithm would remove the points that are redundant but preserve those that really define the shape (like the points at the bottom of the curve). Is there any known algorithm to do that? I expect there is but I'm not sure what to search for on Google. Any help would be appreciated. 回答1: Consider Douglas

Animated curve line in Swift 3

我的未来我决定 提交于 2019-12-20 09:07:19
问题 I want to draw some bezier lines and I want to animate them with a wave effect, Example Do you have some ideas about how I can do this ? Bezier line is it the best method to do it ? I found only 2 libs for this, but they are not really useful for what I need, I try to modify the code of one lib, unfortunately without success https://github.com/yourtion/YXWaveView I found this lib, https://antiguab.github.io/bafluidview/ which does the work, but it written in obj-c, maybe you know something

Ear Image Processing - Finding the point of intersection of line and curve in MATLAB

放肆的年华 提交于 2019-12-20 05:28:07
问题 !1I have the Canny edge output of a ear... i have connected the farthest two boundaries with a line(green). Now I want to draw a normal from the midpoint of this line to the outer boundary(left side). The code i have written helps me to plot a normal but i want the red line to exactly meet the white boundary. Also I want the point of intersection at the point where it meets. I have also thought about another method for the same.By changing 50 to 60 pixels (in the code) the red line crosses

Calculate curvature for 3 Points (x,y)

走远了吗. 提交于 2019-12-19 10:45:17
问题 I have a two dimensional euclidean space. Three points are given. For example (p2 is the middle point): Point2D p1 = new Point2D.Double(177, 289); Point2D p2 = new Point2D.Double(178, 290); Point2D p3 = new Point2D.Double(178, 291); Now i want to calculate the curvature for these three points. double curvature = calculateCurvature(p1, p2, p3); How to do this? Ist there a existing method (no java external libraries)? Curvature: https://en.wikipedia.org/wiki/Curvature Menger Curvature: https:/

add a curve that fits the peaks from a plot in R?

强颜欢笑 提交于 2019-12-19 04:56:47
问题 Is there a function that adds a curve that fits the peaks if given two vectors and their plot? For example, I have: x= c(0:20) x [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 y [1] 19.4 17.9 8.1 11.3 7.8 8.0 5.0 1.7 3.9 5.4 7.5 5.4 4.7 5.0 4.9 3.5 2.9 2.4 1.4 1.7 plot(x,y,xlim=range(x),ylim=range(y)) best, Nanami 回答1: Mathematically speaking, your problem is very poorly defined. You supply a range of discrete values, not a function, for your y values. This means it can not be

Matplotlib, adding text with more than one line. Adding text that can follow the curve

☆樱花仙子☆ 提交于 2019-12-19 03:22:52
问题 I have added text to a plot, coded in each line, and then adjusted it look decent, increase or decrease the width, or change the placement. However, is there a way to have Python know where you want the text and how you want it set? Then I could add the text and Python would work out the details. For example, take a look at the image below: In the figure, I have 3 lines of text in the upper left corner and one line above the line of the plot. I had to adjust the 3 lines to get a decent