#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 26 20:46:27 2024

@author: sam
"""

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

def f(x,y):
    return (x-1)**2 + y**2

def plot(n):
    for i in range(n):
        xi = xn + i*pn*0.2
        plt.plot(xi[0],xi[1],'.')

x = np.linspace(-2,2)
y = np.linspace(-1,1)
X,Y = np.meshgrid(x,y)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
surf = ax.plot_surface(X,Y,f(X,Y))

xn = np.array([-2,-1])
pn = np.array([1,0])



plot(19)