[MOD] used same solution for circle

This commit is contained in:
Eduardo Cueto Mendoza 2020-05-09 12:09:47 -06:00
parent b993fec341
commit 5306105102
2 changed files with 8 additions and 2 deletions

View File

@ -22,6 +22,12 @@ end
typealias Point Union{Tuple{Float64,Float64}, Tuple{Int64,Int64}} typealias Point Union{Tuple{Float64,Float64}, Tuple{Int64,Int64}}
"Create circle from point and radius"
function Circle(p::Point,radius)
px,py = p
Circle(px,py,radius)
end
"Create rectangle from to points `p` at the top left corner and `q` at the lower right corner" "Create rectangle from to points `p` at the top left corner and `q` at the lower right corner"
function Rectangle(p::Point,q::Point) function Rectangle(p::Point,q::Point)

View File

@ -2,9 +2,9 @@ include("./11_DefiningTypes.jl")
include("./11_points.jl") include("./11_points.jl")
r1 = Rectangle(D,B) r1 = Rectangle(D,B)
c1 = Circle(A...,2) c1 = Circle(A,2)
r2 = Rectangle(K,I) r2 = Rectangle(K,I)
c2 = Circle(F...,1) c2 = Circle(F,1)
g1 = group(c1,r1) g1 = group(c1,r1)
g2 = group(c2,r2) g2 = group(c2,r2)