rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

implicit and contour plots fail on functions with constant areas #2871

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 00:11:26 Created by macrakis on 2021-09-09 17:12:29 Original: https://sourceforge.net/p/maxima/bugs/3851


The contour plot plot2d([contour,floor(x)-floor(y)],[x,0,5],[y,0,5]) produces a plot consisting of multiple vertically-oriented lines.

Similarly for the implicit plot plot2d(floor(x)=floor(y),[x,0,5],[y,0,5]).

Attachments:

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 00:11:28 Created by macrakis on 2021-09-09 17:14:12 Original: https://sourceforge.net/p/maxima/bugs/3851/#ef83


Diff:


--- old
+++ new
@@ -1,3 +1,3 @@
-``plot2d(floor(x)=floor(y),[x,0,5],[y,0,5])`` produces a plot consisting of multiple vertically-oriented lines.
+The contour plot ``plot2d([contour,floor(x)-floor(y)],[x,0,5],[y,0,5])`` produces a plot consisting of multiple vertically-oriented lines.

-Similarly for the implicit plot ``plot2d(floor(x)=floor(y),[x,0,5],[y,0,5]);``
+Similarly for the implicit plot ``plot2d(floor(x)=floor(y),[x,0,5],[y,0,5])``.
rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 00:11:31 Created by macrakis on 2021-09-09 17:15:32 Original: https://sourceforge.net/p/maxima/bugs/3851/#b0f4


rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 00:11:35 Created by villate on 2022-02-11 09:29:36 Original: https://sourceforge.net/p/maxima/bugs/3851/#d166


This is one way in which an artist would draw a shaded area using only a pen with a very fine tip instead of brushes (a good artist would probably use cross-hatching ). It can be better with more sample points:

plot2d(floor(x)=floor(y),[x,0,5],[y,0,5],[sample,200,200]);

I don't consider this a bug but rather a feature, because the current version of plot2d can only draw lines; it can not shade a complete region.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 00:11:38 Created by villate on 2022-02-11 09:51:02 Original: https://sourceforge.net/p/maxima/bugs/3851/#8bf6


For comparison, see in the attachments how the contours of floor(x)-floor(y) looked by using the old function contour_plot (before version 5.45) and using

plot2d([contour,floor(x)-floor(y)],[x,0,5],[y,0,5],[sample,200,200],nolegend)

(version 5.45 and after)

Attachments:

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 00:11:42 Created by villate on 2022-03-09 12:59:18 Original: https://sourceforge.net/p/maxima/bugs/3851/#0c1a