Math & Collisions library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: mlib: Math Library

Post by Robin »

davisdude wrote:I have most of it documented, except some of the newer ones, 'cause I sorta forgot... :P
Tests are not documentation. You do have some documentation in your README, but it's rather curt.
Help us help you: attach a .love.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: mlib: Math Library

Post by Roland_Yonaba »

Robin wrote: Tests are not documentation. You do have some documentation in your README, but it's rather curt.
Totally true. I second that. Plus, that is the reason for what I suggested LDoc. It helps parsing documentation from code comments, and also let you writeadditional documentation in a narrative style, which is awesome.
But beware, writing documentation is tedious. But in the end, it gives to the whole project a bit more of genuine and some seriousness.
And it is really helpful to the user. In doubt, no need to ask systematically a question, one can read the docs first. :megagrin:
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: mlib: Math Library

Post by davisdude »

Robin wrote:Tests are not documentation. You do have some documentation in your README, but it's rather curt.
Oh, I thought tests were documentation. My bad.
As for the documentation, do you mind explaining how I could make it more in-depth? I thought they were pretty clear, myself (but then again, I did make them, so I know how they work...)

Not that I think that LDoc is bad or anything, it's just like it seems like it's too much to work with. I may still do it, but for now I don't think I will.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: mlib: Math Library

Post by davisdude »

1.9.1 is now out!
Changes:
v. 1.9.1 -Made mlib.line.closestPoint able to take either two points on the slope or the slope and intercept.
v. 1.9.0 -Added mlib.lineSegmentIntersects (no affiliation with previous one (changed to mlib.line.segment.intersect)) and mlib.line.closestPoint
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: mlib: Math Library

Post by Robin »

davisdude wrote:As for the documentation, do you mind explaining how I could make it more in-depth?
When reading an API documentation, I want to know the following things: (bolded are the things missing)
  • The function name
  • What the function does/calculates exactly
  • When I would want to use it
  • The arguments, their description, domain, units, typical and extreme values
  • A description for the return value, its range, units, typical and extreme values
The functions in milb.stats are pretty well-documented. The ones in mlib.line and mlib.polygon rather less so. mlib.math is a mixed bag, and the documentation for mlib.circle is decent.
Help us help you: attach a .love.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: mlib: Math Library

Post by davisdude »

Robin wrote:When reading an API documentation, I want to know the following things: (bolded are the things missing)
  • The function name
    What the function does/calculates exactly
    When I would want to use it
    The arguments, their description, domain, units, typical and extreme values
    A description for the return value, its range, units, typical and extreme values
The functions in milb.stats are pretty well-documented. The ones in mlib.line and mlib.polygon rather less so. mlib.math is a mixed bag, and the documentation for mlib.circle is decent.
Okay, thanks. I'll get to work on that.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: mlib: Math Library

Post by davisdude »

Updated readme! Hopefully my documentation is more complete now!
1.9.2 is also out! I made some changes to be compatible with 0.9.0!
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: mlib: Math Library

Post by davisdude »

So, how's the documentation? Any better?
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: mlib: Math Library

Post by Robin »

The documentation is much better.

Something weird is going on here: https://github.com/davisdude/mlib#mlibmathprime-1
Was that a mistake? (Also, I doubt you often have to check if multiple numbers are prime, so the special casing seems to be a bit weird. Looking at the source code for mlib.math.prime that it is a really bad. For one thing, checking if a number is prime can trivially be done in O(sqrt(n)), but your algorithm takes O(n).)

Also, please don't double post after only ten hours, especially if you have nothing to add.
Help us help you: attach a .love.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: mlib: Math Library

Post by davisdude »

Robin wrote:Also, please don't double post after only ten hours, especially if you have nothing to add.
Oh, okay. Sorry.
Also: I fixedit now. After spending ~6 straight hours on it, I knew there was bound to be at least one mistake! :shock:
Also, if you don't mind, how would I decrease the amount of time taken? I didn't look up a formula, I just sort of did what made sense to me.
I don't really know of a case where you would check for multiple numbers, but just thought it would be a nice added functionality. :D
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 5 guests