$$V(x) = w\left(\frac{L}{2} - x\right)$$$$M(x) = \frac{w}{2}\left(L x - x^2\right)$$$$\theta(x) = \frac{- w}{2 EI}\left(\frac{L x^2}{2} - \frac{x^3}{3} +C\right)$$$$\Delta(x) = \frac{- w}{2 EI}\left(\frac{L x^3}{6} - \frac{x^4}{12} +Cx + D \right)$$
$$\Delta(0) = \frac{-w}{2 EI}\left(\frac{L\cdot 0^3}{6} - \frac{0^4}{12} +C\cdot 0 + D \right) = 0 \therefore D = 0$$$$\Delta(L) = \frac{-w}{2 EI}\left(\frac{L^4}{6} - \frac{L^4}{12} +CL \right) = 0 $$$$\frac{L^4}{6} - \frac{L^4}{12} +CL = 0 $$$$ CL = \frac{L^4}{12} - \frac{L^4}{6} $$$$ CL = \frac{L^4}{12} - \frac{2 L^4}{12} $$$$ CL = - \frac{L^4}{12} $$$$ C = -\frac{L^3}{12}$$$$\Delta(x) = \frac{- w}{2 EI}\left(\frac{L x^3}{6} - \frac{x^4}{12} -\frac{L^3}{12}x \right)$$
$$\theta(x) = \frac{-w}{2 EI}\left(\frac{L x^2}{2} - \frac{x^3}{3} - \frac{L^3}{12}\right)$$$$\theta(0) = \frac{-w}{2 EI}\left(\frac{L \cdot 0^2}{2} - \frac{0^3}{3} - \frac{L^3}{12}\right)$$$$\theta(0) = \frac{-w}{2 EI}\left(- \frac{L^3}{12}\right)$$$$\theta(0) = \frac{w L^3}{24 EI}$$
$$\frac{\theta(0)}{\Delta(L/2)} = \frac{\frac{w L^3}{24 EI}}{\frac{5 w L^4}{384 E I}}$$
$$\frac{\theta(0)}{\Delta(L/2)} = \frac{384}{5\cdot 24\cdot L}$$
$$\frac{\theta(0)}{\Delta(L/2)} = \frac{16}{5 L}$$$$\theta(0) = \frac{16}{5 L}\Delta(L/2)$$
$$P_0 = (x_0,y_0)\text{, known}$$$$P_1 = (x_1,y_1)\text{, known}$$$$C_0 = (x_2,y_2)$$$$C_1 = (x_3,y_3)$$$$P_I = (x_m,y_m)\text{, known}$$$$y - y_m = \frac{\frac{y_0+y_3}{2}-y_m}{\frac{x_0+x_3}{2}-x_m}(x-x_m)\text{, known}$$$$\frac{\frac{y_0+y_3}{2}-y_m}{\frac{x_0+x_3}{2}-x_m} = -\frac{x_3-x_0}{y_3-y_0}\text{, known}$$
$$y - y_c= m_{perp} (x-x_c)$$$$y - y_c= m_{perp} x-m_{perp} x_c$$$$y = m_{perp} x-m_{perp} x_c + y_c$$$$y = m_{perp} x + (-m_{perp} x_c + y_c)$$$$y = m_{perp} x + b_{perp}$$$$y=a x^4 + b x^3 +c x^2 +d x + e$$$$ 0 = a x^4 + b x^3 +c x^2 +(d-m_{perp}) x + (e-b_{perp})$$
$$\Delta(x) = \frac{- w}{2 EI}\left(- \frac{x^4}{12}+\frac{L x^3}{6} -\frac{L^3}{12}x \right)$$$$\Delta(x) = \frac{w}{2 EI}\left(\frac{x^4}{12} - \frac{L x^3}{6} +\frac{L^3}{12}x \right)$$
$$y_0 - m_0 x_0 = - m_0 x_1 +y_1 \tag{1}$$$$y_3-m_1 x_3 = -m_1 x_2+y_2\tag{2}$$$$x_m -\frac{x_0+x_3}{8}= \frac{3}{8}x_1+\frac{3}{8}x_2 \tag{3}$$$$y_m - \frac{y_0+y_3}{8}=\frac{3}{8}y_1+\frac{3}{8}y_2 \tag{4}$$$$Y = \begin{bmatrix}y_0 - m_0 x_0\\y_3-m_1 x_3\\x_m -\frac{x_0+x_3}{8}\\y_m - \frac{y_0+y_3}{8}\end{bmatrix}\qquad E = \begin{bmatrix}-m_0&0&1&0\\0&-m_1&0&1\\3/8&3/8&0&0\\0&0&3/8&3/8\end{bmatrix}\qquad C = \begin{bmatrix}x_1\\x_2\\y_1\\y_2\end{bmatrix}$$$$[Y]=[E][C]$$$$[C]=[E]^{-1}[Y]$$

In [1]:
# Path CurveManip.py



from IPython.display import SVG
from numpy import matrix
from numpy.linalg import inv, pinv
from numpy import transpose as T
from collections import namedtuple
from numpy import sin, cos, tan, array, pi
import numpy as np
# from SVG_lib import point

def rotate(point, base, angle, DEBUG = False):
    "Rotates the point about the bas by the angle"
    R = matrix(((cos(angle),-sin(angle)),(sin(angle),cos(angle))))
    point = array(point)
    base = array(base)
    tmp = point - base
    R_tmp = array(T(R*T(matrix(tmp)))).reshape((1,2))
    R_point = array(R_tmp[0]+T(base))#.reshape((1,2))
    if DEBUG:
        Debug_rotate = namedtuple('Debug_rotate','point angle_deg tmp R_tmp_size R_tmp base R_point')
        debug = Debug_rotate(point, angle/pi*180, tmp, R_tmp.size, R_tmp, base, R_point)
        print(debug)
        print()
    return R_point

def translate(point, vector):
    "Returns a point (list) that is displaced from the original point be the vector (list)"
    new_point = [x0+dx for x0,dx in zip(point, vector)]
    return new_point

def reflect_y_axis(point):
    "returns a point mirrored about the y axis"
    px, py = point
    return [-px, py]

def reflect_x_axis(point):
    "returns a point mirrored about the x axis"
    px, py = point
    return [px, -py]

def mirror(point, mirror_line = [(0,0),(0,-1)]):
    "Mirror a point about a line defined by two points"
    p0, p1 = mirror_line
    # Find angle of mirror line
    angle = np.arctan2((p1[1]-p0[1]),(p1[0]-p0[0]))
    # Rotate all points to make mirror line parallel to y-axis
    flip_angles = [-angle,-pi/2]
    for flip_angle in flip_angles:
        p0 = rotate(p0,[0,0],flip_angle)
        p1 = rotate(p1,[0,0],flip_angle)
        point = rotate(point,[0,0],flip_angle) 
    if round((p0[0]-p1[0])*10000)!=0: #check for errors
        er = "problem with fil_angle.  post rotate x0, x1 = {}, {}".format(p0[0],p1[0])
        raise(RuntimeError(er))
    # translaste points so mirror line is on y-axis
    point = translate(point,[-p0[0],0])
    point = reflect_y_axis(point)
    # translate back to original location
    point = translate(point,[p0[0],0])
    # rotate to original angle
    flip_angles = [pi/2,angle]
    for flip_angle in flip_angles:
        point = rotate(point,[0,0],flip_angle)
    p_x, p_y = float(point[0]), float(point[1])
    return [p_x, p_y]