I made 30 random points using np.random.uniform.
And i want these points to be divided by random line like the picture below.
Could you give me some codes or advice??
Making points is easy but dividing is difficult ..
Code is like this
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import random
import math
m=np.random.uniform(-10,10,30)
n=np.random.uniform(-10,10,30)
a=random.randrange(-5,5)
b=random.randrange(-10,10)
x= np.array(range(-10,20))
y=a*x+b
plt.plot(x,y)
plt.scatter(m,n)
plt.xlim(-10,10)
plt.ylim(-10,10)
plt.show()
I want to devide points by the line like this
I feel like using for loop is possible but I don't know how. Could you give me some advice??
