<jupyter_start><jupyter_text>What does it mean to extend a line?<jupyter_code>def extend_line(A,B,length_to_extend):
    v = B-A
    v_bar = np.sqrt(np.sum((B-A)**2))
    v_hat = v/v_bar
    
    b_dash = B+ length_to_extend*v_hat
    a_dash = A- length_to_extend*v_hat
    
    x1,x2= a_dash[0],b_dash[0]
    y1,y2 = a_dash[1],b_dash[1]
    return (x1,x2),(y1,y2)<jupyter_output><empty_output><jupyter_text>Row Picture<jupyter_code>x_1 = [0,1]
y_1 = [0,2]

x_2 = [-3,-1]
y_2 = [0,1]

(nx1,nx2),(ny1,ny2) = extend_line(np.array([0,0]),np.array([1,2]),3)
(nx12,nx22),(ny12,ny22) = extend_line(np.array([-3,0]),np.array([-1,1]),3)

plt.plot((nx1,nx2),(ny1,ny2) ,'--',color='orange')
plt.plot(x_1,y_1,'-o',label = "line that solves equation 1",color='orange')
plt.plot((nx12,nx22),(ny12,ny22) ,'--',color='blue')
plt.plot(x_2,y_2,'-o',label = "line that solves equation 2",color='blue')
plt.legend()
plt.show()<jupyter_output><empty_output><jupyter_text>Column Picture<jupyter_code>vector1 = matrix_A[:,0]
vector2 = matrix_A[:,1]
def plot_vector(vector,vector_name,line_type='-'):
    plt.plot([0,vector[0]],[0,vector[1]],line_type,label=vector_name,color='blue')
    
def plot_vector_sum(v1,v2,x,y,plot_process=True):
    if plot_process:
        plt.plot([0,x*v1[0]],[0,x*v1[1]],'--',label="v1")
        #x coordinates have to be the y cordinate of vector 1
        #y coordinate is shifted+scaling
        plt.plot([0,y*v2[0]] + x*v1[0] ,[0,y*v2[1]] + x*v1[1],'--',label="v2")
    plot_vector(x*v1+y*v2,"v1+v2",)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2198443579766537, 'fraction_numerical': 0.06355382619974059, 'mean_word_length': 5.56595744680851, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '577413', 'license': 'MIT', 'n_tokens_mistral': 747, 'n_tokens_neox': 718, 'n_words': 89, 'path': 'Lecture 1 - Two Vars.ipynb', 'repo_name': 'kritim13/gilbert-strang-lin-alg-python', 'size': '1542'}