using Plots
function get_rotation_matrix(rad)
rot = [cos(rad) -sin(rad); sin(rad) cos(rad)]
return rot
end
get_rotation_matrix (generic function with 1 method)
base_point1 = Float64[1. 0.; 0. 1]
base_point2 = Float64[0.75 0.; 0. 0.75]
base_point3 = Float64[0.5 0.; 0. 0.5]
base_point4 = Float64[0.25 0.; 0. 0.25]
base_point5 = Float64[0. 0.; 0. 0.]
x_points1 = []
y_points1 = []
x_points2 = []
y_points2 = []
x_points3 = []
y_points3 = []
x_points4 = []
y_points4 = []
x_points5 = []
y_points5 = []
function plotting()
for i in 1:12
deg = i * 30
rad = deg * π / 180
rot = get_rotation_matrix(rad)
rotated1 =[rot* base_point1]
rotated2 =[rot* base_point2]
rotated3 =[rot* base_point3]
rotated4 =[rot* base_point4]
rotated5 =[rot* base_point5]
push!(x_points1, rotated1[1][1])
push!(y_points1, rotated1[1][2])
push!(x_points2, rotated2[1][1])
push!(y_points2, rotated2[1][2])
push!(x_points3, rotated3[1][1])
push!(y_points3, rotated3[1][2])
push!(x_points4, rotated4[1][1])
push!(y_points4, rotated4[1][2])
push!(x_points5, rotated5[1][1])
push!(y_points5, rotated5[1][2])
end
end
plotting (generic function with 1 method)
plotting()
plot([x_points1, x_points2, x_points3, x_points4, x_points5], [y_points1, y_points2, y_points3, y_points4, y_points5], st=:scatter, size=(400,400))
plotting()
plot([x_points1, x_points2, x_points3, x_points4, x_points5], [y_points1, y_points2, y_points3, y_points4, y_points5], st=:scatter, size=(400,400))
UndefVarError: plotting not defined Stacktrace: [1] include_string(::String, ::String) at ./loading.jl:522