okay, does it work for polar or elliptic coordinates?
draw(x=1, x, y, range == [-3..3, -3..3])
does give a vertical line. and what if i want θ=1 in polar coordinates?
draw(t=1, t, r, range == [-%pi..%pi, -3..3], coordinates==polar)
------- Original Message -------
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/20230501192319.awmzhmmaavfngxzo%40fricas.math.uni.wroc.pl.
i guess this works:
draw(x=1, x, y, range == [-3..3, -3..3])
because the program uses Cartesian coordinates to make plots, and this command has everything to provide those [x=1, y=-3..3]. in case of other coordinate systems:
draw(t=1, t, r, range == [-3..3, -3..3], coordinates==polar)
there are no Cartesian coordinates and the polar(pt) and elliptic(a) functions are of no help because theta is constant. i think a simple solution might be as follows:
if t is not π/2 [incl. ±πn] then x=-3..3 and y=x*tan(theta).
if t=π/2 or t=3π/2 then x=0 and y=-3..3.
but that would work if the ranges are still for x and y for Cartesian coordinates and not for r and theta.
------- Original Message -------
On Thursday, May 4th, 2023 at 9:30 PM, Waldek Hebisch de...@fricas.math.uni.wroc.pl wrote:
Well, as I wrote in another thread, coordinates work on top of computation of points. First we get point (x, y), and then ct((x,y)), where ct is coordinate transformation. ATM I am not sure why equation plot does not support coordinate transformation. One possiblity is that original author did not consider them useful. Anothother may be confusion due to ranges: does range mean orignal coordinates or the final ones.
One possiblity of getting transformations is to extract list of intervals and transform them. One can do:
ob := makeObject(x^2 + y^2 = 1, x, y, range == [-1..1, -1..1])
llp := pointLists(ob)that gives longish output giving you list of lists of points. Graph may contain multiple curves, single curve is represented by list of points. In principle one can transform each point to new coordinates and in this way transform the whole graph. Namely
ptr := polar$CoordinateSystems(DoubleFloat)
llp1 := [[ptr(p) for p in lp] for lp in llp]You can get it on the screen via
draw(first(llp1))
thank you for introducing me to FriCAS commands related to plotting.
judging from what you said, this command:
draw(first(pointLists(makeObject(1, t=0..2*%pi, coordinates==polar))))
as well as this one:
draw(1, t=0..2*%pi, coordinates==polar)
don't do the transformation you are talking about and yet produce same correct plots in polar coordinates. a user gives a function in polar coordinates and gets a plot in polar coordinates. why would he want a polar graph for a Cartesian function? as far as i understand, the problem is not in transforming a graph, but in making the program treat some implicit functions in non-Cartesian coordinates properly. correct me if i'm wrong, pointLists always returns points in Cartesian coordinates, so real transformation [polar(pt), elliptic(a), etc] should occur either in pointLists itself or in makeObject. probably, in the former.
thank you again for explaining to me how FriCAS works internally.
Our terminalogies differ: I would say that plot is in cartesion coordinates.
okay. i use words 'plot' and 'graph' interchangeably but in this case let's make a distinction between them. graph is a visual representation of a function or equation. if the function or equation is polar then its graph is also polar. and plot is a list of points in Cartesian coordinates, although the points may approximate a non-Cartesian graph.
that being so, my phrase should be as follows:
a user gives a function in polar coordinates and gets a graph in polar coordinates.
though in fact he gets a plot approximating the polar graph. but that's what the user wanted because now he is able to see what the polar graph looks like.
Point is representd using coordinates which one could call cartesian, but I am affraid that this is different meaning of cartesian that you use.
i think now we have one and the same meaning for Cartesian coordinates.
Coming back to curves given by equations: one needs to inserts transformation in correct place. Finding correct place probably is not very difficult, but is not entirely obvious either.
there's only one place where transformation occurs. like you said:
... 'makeObject' is doing transformation from polar to cartesion coordinates.
As I wrote, drawing code tries to ensure that point lists are good approximation to the curve. That involves some arithmetic which in case of curves given by equations it mixed with equation solving.
somehow makeObject understands that graph of the Cartesian equation x=constant is a straight line and it only takes two points to draw a plot:
-> pointLists(makeObject(x=1, x, y, range==[-3..3,-3..3]))
[[[1.0, 3.0], [1.0, - 3.0]]]
for the polar equation theta=constant the graph is also a straight line and instead of ignoring the coordinates option:
-> pointLists(makeObject(t=1, t, r, range==[-3..3,-3..3], coordinates==polar))
[[[1.0, 3.0], [1.0, - 3.0]]]
because polar(pt) won't work here, makeObject should return this:
[[[3.0, 1.9262778478], [-3.0, -1.9262778478]]]
and that requires dealing with non-Cartesian polynomial equations. i don't know how it works for Cartesian ones, so have no idea if there would be any differences.
by the way, why is a linear function plotted as if its slope is always 1? try this for example:
-> draw(10*x, x = -3..3)
or -1 if the slope is negative.
------- Original Message -------
On Sunday, May 7th, 2023 at 1:37 PM, Waldek Hebisch de...@fricas.math.uni.wroc.pl wrote:
Well, that is "fit into available window" feature. Click on Units
button in control panel to turn Unit on, you will see that function
values change much more than arguments.
okay, i see. is there a way to disable it from the command line?
And what did you expect? Having ony small part of the graph and
rest clipped?
i think this defeats the purpose of graphs as a visual representation as opposed to tabular form or any other form with a list of numbers. a user should control what part of the graph he wants to see by changing the ranges.
------- Original Message -------
On Sunday, May 7th, 2023 at 8:37 PM, Waldek Hebisch de...@fricas.math.uni.wroc.pl wrote:
Try:
draw(10*x, x = -3..3, toScale==true)
yes, that's much better. thank you.