I want to pass an array of objects to a function and return another array of the same size. How should I do this ? The code should be so fast. For example consider the below code:
struct triangle
height::Float64
base::Float64
end
function area(height::Float64, base::Float64)
return 0.5*base*height
end
I want to define a function which returns the area of an array of triangles. What is the fastest way to do it?