sambitdash / Rectangle.jl

Simple Rectangle operations in 2-D.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show in documentation some examples on how to construct a Rectangle

JaapHaitsma opened this issue · comments

Basically how to call contstructor

@JaapHaitsma any specific data types you are interested in? I will try to update accordingly. Never took up the initiative as there are very few users of the library as such.

I have some code base that uses it quite a bit. It would be good to have a small doc string for each function and on the README.md some more general explanation

If 10, 15 are the x and y coordinates of one corner and 100, 120 of the diagonally opposed corner you construct a Rectangle like this

r = Rect(10, 15, 100, 120)
or
r = Rect([10 100; 15 120])

The Base.show implementation I would also make clearer. Maybe something like

print(io, "Rect: left_bottom (x, y) = ($(lx(r)), $(ly(r))) right_upper(x,y) = ($(rx(r)), $(ry(r)))")

Great to know someone is using the library extensively. If you have some ideas in mind please submit PRs. I will review and accept them. I will do a refresh of the library in a couple of weeks and shall keep in mind to update some docstrings as well.