curve

Center point on html quadratic curve

孤街浪徒 提交于 2019-12-12 07:35:32
问题 I have a quadratic curve drawn on html canvas using context.quadraticCurveTo(controlX, controlY, endX, endY); . I have the control-point and the starting and end points, which are not necessarily level with each other horizontally. How can I find the centre point on the curve using these parameters? Actually I want to put a div tag on this center point. Is there any equation solving involved in this process? 回答1: quadraticCurveTo draws a quadratic Bézier curve. The formulas to calculate the

How to guess the actual lorentzian function without relaxation behavior with Least square curve fitting

守給你的承諾、 提交于 2019-12-12 05:26:58
问题 I wanted to ask you if it would be possible to implement this idea: So all in all, I measure a signal (blue curve, See plot of the measured data and the initial guess for the lorentzian function), this signal is a convolution of a lorentzian function and a certain relaxation kernel. I have an initial guess of the lorentzian function (see green curve), but as you notice, the green curve is not really aperfect lorentzian function , as it is still dissymmetric in the bottom. I have never used

Implementing Sigmoid Curves in C++

烂漫一生 提交于 2019-12-12 02:37:21
问题 I've been trying to implement Sigmoid curves since 12 hours ago and i could not manage to get it up. I'm using Microsoft Visual Studio 2010. The formula is y = 1/(1+exp(-e)) Yet when i try implementing in the codes it does not work, why? Can any experts please guide me along, thank you. for(int y=0; y<bih.biHeight; y++) { for(int x=0; x<bih.biWidth; x++) { SetPixel(hdc, (double)1/((double)1+exp(double(-x))), bih.biHeight-x, red); } } 回答1: Your result for the (double)1/((double)1+exp(double(-x

Curve Fitting for equation with two parameters

不打扰是莪最后的温柔 提交于 2019-12-12 01:46:36
问题 I have two arrays: E= [6656400; 13322500; 19980900; 26625600; 33292900; 39942400; 46648900; 53290000] and J=[0.0000000021; 0.0000000047; 0.0000000128; 0.0000000201; 0.0000000659; 0.0000000748; 0.0000001143; 0.0000001397] I want to find the appropriate curve fitting for the above data by applying this equation: J=A0.*(298).^2.*exp(-(W-((((1.6e-19)^3)/(4*pi*2.3*8.854e-12))^0.5).*E.^0.5)./((1.38e-23).*298)) I want to select the starting value of W from 1e-19 I have tried the curve fitting tools

How to make a curve on a rectangle's top in css? only in top edge

限于喜欢 提交于 2019-12-12 00:58:40
问题 I want to create the following shape: Important: if I use "Border Radius" I get this (and I do not want this result): 回答1: Here are DEMO HTML: <div id="gray"> <div id="red"></div> </div> CSS: #gray{ height: 100%; background-color: #ccc; overflow: hidden; } #red{ width: 150%; height: 150%; background-color: #f00; border-radius: 100%; top: 50%; left: -25%; right: 0; position: relative; } 回答2: Something like this would be roughly equivalent: http://jsfiddle.net/ny4Q9/ css: .curvetop { position:

Bezier curve with control points within the curve

一曲冷凌霜 提交于 2019-12-11 18:46:36
问题 Please see the image below. This path object is created using 4 Bezier curve on each side. Currently I am facing a problem when I try to get bounds of this path object created using cubic brazier curves. As you can see top and bottom sides have control point away from the curve which makes bounds totally inaccurate. So my question is is it possible to create a jigsaw puzzle piece like in the image having all control points on or at the level of the curve. ( That is creating a curve and

Creating a curve between two points each with normalized vectors

落爺英雄遲暮 提交于 2019-12-11 11:43:55
问题 So I need a write method to create a curve between two points, with each point having a normalized vector pointing in an arbitrary direction. I have been trying to devise such a method but haven't been able to wrap my head around the math. Here, since a picture is worth a thousand words this is what I need: In the picture, the vectors are perpendicular to the red lines. I believe the vectors need to be weighted the same with a weight equivalent to the distance between the points. It needs to

Draw angles lines over circle and get the intersecting points

我是研究僧i 提交于 2019-12-11 08:37:29
问题 I wish to draw angle lines over a circle (I change the angles in the script). The plot line I get is 0 angle, why does the script not show me all of them, and how can I fix it? In addition, how can I calculate the intersection points? Script: clc; clear; close all; r=1000; % based on : https://stackoverflow.com/questions/29194004/how-to-plot-a-circle-in-matlab nCircle = 1000; t = linspace(0,2*pi,nCircle); xCircle = 0+ r*sin(t); yCircle = 0+ r*cos(t); line(xCircle,yCircle ); axis equal; hold

Check if a curve is closed

江枫思渺然 提交于 2019-12-11 05:18:30
问题 How can I check efficiently if a curve is closed? For example look this figure: The curve will always be white on a black background. I tried with flood fill algorithm but not works well with this situation (I don't understand how modify it). Here the code: public static boolean isWhite(BufferedImage image, int posX, int posY) { Color color = new Color(image.getRGB(posX, posY)); int r=color.getRed(); int g=color.getGreen(); int b=color.getBlue(); if(r==0&&g==0&&b==0) return false; return true

How do i color the Area below the two curves?

社会主义新天地 提交于 2019-12-11 03:28:06
问题 I have the following combinations of graphs: import pylab as pl import numpy as np def gauss2d(x,sigma): return (1/np.sqrt(2*np.pi*sigma ))*np.exp(-1/2*(x/sigma)**2 ) def markParameters(m,s,textsigma, textmean): p1=gauss2d(s,s) p2=gauss2d(0,s) pl.annotate("", xy=(m-s, p1), xycoords='data', xytext=(m+s, p1), textcoords='data', arrowprops=dict(arrowstyle="<->", connectionstyle="arc3"),) pl.text(m,p1,textsigma,horizontalalignment='center',verticalalignment='top') pl.annotate("", xy=(m, p2*1.1),