Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function called penMotion. It should take two arrays as input, one containing the x - coordinates of the pen stroke, and one containing
Write a function called penMotion. It should take two arrays as input, one containing the x
coordinates of the pen stroke, and one containing the coordinates. The function should
return two arrays. The first should contain the arclength value of each point on the stroke,
and the second should contain the pen speed at each point. The values must be returned in
that order.
The arc length, of the point on the stroke is computed as:
The first data point has an arc length value of zero.
The speed, of the point on the stroke is computed as:
where is the time between the two data points, which we will assume is This
assumption is valid if the data points are sampled at a constant rate. Also, assume that the
first point on the stroke has a speed of zero, as it is not possible to calculate the speed using
this equation.
Hint: Your loops for computing arc length and speed should exclude the first data point on
the stroke.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started