Programming Ur3 for writing

I am a current Intern, and my task is to program a robot to write. for example, I want to program the robot to draw a sine wave. Please, I need a clear answer on how to go about this, I am the only one working on this provide and am new to robotics. Your guide will be of great help.

I did this some time ago for a demo.
first create a Good TCP (tip of the pen)
Create a Plane with x along the wavelength direction

def draw_sine_wave():

Define sine wave parameters

amplitude = 0.25 # Amplitude of the sine wave (adjust as needed)
wavelength = 0.5 # Wavelength of the sine wave (adjust as needed)
frequency = 0.1 # Frequency of the sine wave (adjust as needed)

Move to the starting position

start_pos = pose_trans(Wave_plane, p[0, 0, 0, 0, 0, 0])
movel(start_pos, a=1.2, v=0.25)

Calculate the number of points along the x Axis to draw the sine wave

points = 100
delta_x = wavelength / points

Draw the sine wave (For Loop)

for i in range(points + 1):
x = i * delta_x
y = amplitude * sin(2 * pi * frequency * x)
pose_waypoint = pose_trans(pose_start, p[x, y, 0, 0, 0, 0])
movel(pose_waypoint, a=0.5, v=0.1)