Calculating a point on an ellipse
By : Kamal Jeet
Date : March 29 2020, 07:55 AM
Any of those help Why not use the polar form of an ellipse where the angle is measured from the ellipse centre??? http://en.wikipedia.org/wiki/Ellipse#Polar_form_relative_to_center From this equation, if you know the value of the angle between A and B (say theta), and you know the value of central angle of the new point C (say phi), then your required point D can be calculated from this polar form using an angle (theta + phi)

How to efficiently generate a straight line with random slope and intercept in Python?
By : Bradley Williams
Date : March 29 2020, 07:55 AM
wish helps you You can use numpy array broadcasting to create your y array in one step as shown below. code :
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(start=0, stop=5, step=0.1)
n_data = len(x)
n_rnd = 1000
m = np.random.normal(loc=1, scale=0.3, size=n_rnd)
b = np.random.normal(loc=5, scale=0.3, size=n_rnd)
y = m * x[:, np.newaxis] + b
for val in y.transpose():
plt.plot(x, val, alpha=0.05)
# Or without the iteration:
# plt.plot(x, y, alpha=0.05)
plt.show()

Calculating shortest distance from point to line defined by intercept and slope in R
By : Adn Agung
Date : March 29 2020, 07:55 AM
I wish this helpful for you Test this (Modified from here) code :
#Perpendicular distance from point 'a' to a line with 'slope' and 'intercept'
dist_point_line < function(a, slope, intercept) {
b = c(1, intercept+slope)
c = c(intercept/slope,0)
v1 < b  c
v2 < a  b
m < cbind(v1,v2)
return(abs(det(m))/sqrt(sum(v1*v1)))
}
dist_point_line(c(2,1), 1, 0)
#[1] 0.7071068
apply(df, 1, function(x) dist_point_line(as.numeric(x[1:2]), slope = 1, intercept = 0) )
#[1] 0.0000000 0.7071068 1.4142136 2.1213203 2.8284271 3.5355339 2.8284271 2.1213203 1.4142136 0.7071068

Equation of a straight line passing through two points and distance point straight  C
By : sharoon albert
Date : March 29 2020, 07:55 AM
wish of those help first of all transform your line equation to another form Ax + By + C = 0 // keep int mind that A^2 + B^2 != 0 (this means that A or B are unable to be equall to zero in one moment) code :
d = abs(A * Mx + B * My + C)/sqrt(A * A + B * B)

Graph point on straight line (number line) in Python
By : Anna MM
Date : March 29 2020, 07:55 AM
it should still fix some issue I don't know of a specific package for this but you could do something like this in Matplotlib using hlines, vlines and plot.

