emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Spreadsheet calc complex number display format
@ 2020-07-05 23:00 Rob Duncan
  2020-07-06  6:09 ` Russell Adams
  2020-07-07  0:59 ` Rob Duncan
  0 siblings, 2 replies; 6+ messages in thread
From: Rob Duncan @ 2020-07-05 23:00 UTC (permalink / raw)
  To: emacs-orgmode

Is there a way to specify the display format used for complex number
calculations in the table spreadsheet?  In particular I'd like to be
able control whether a value is displayed in rectangular or polar form.

Thanks,

Rob.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Spreadsheet calc complex number display format
  2020-07-05 23:00 Spreadsheet calc complex number display format Rob Duncan
@ 2020-07-06  6:09 ` Russell Adams
  2020-07-06 21:25   ` Rob Duncan
  2020-07-07  0:59 ` Rob Duncan
  1 sibling, 1 reply; 6+ messages in thread
From: Russell Adams @ 2020-07-06  6:09 UTC (permalink / raw)
  To: emacs-orgmode

On Sun, Jul 05, 2020 at 04:00:47PM -0700, Rob Duncan wrote:
> Is there a way to specify the display format used for complex number
> calculations in the table spreadsheet?  In particular I'd like to be
> able control whether a value is displayed in rectangular or polar form.

I often enforce two decimal places in my tables:

#+TBLFM: @9$1=vsum(@-I..@-II);%0.2f

https://orgmode.org/manual/Formula-syntax-for-Calc.html

Can that help you with polar form?

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Spreadsheet calc complex number display format
  2020-07-06  6:09 ` Russell Adams
@ 2020-07-06 21:25   ` Rob Duncan
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Duncan @ 2020-07-06 21:25 UTC (permalink / raw)
  To: emacs-orgmode

Russell Adams <RLAdams@AdamsInfoServ.Com> writes:

> On Sun, Jul 05, 2020 at 04:00:47PM -0700, Rob Duncan wrote:
>> Is there a way to specify the display format used for complex number
>> calculations in the table spreadsheet?  In particular I'd like to be
>> able control whether a value is displayed in rectangular or polar form.
>
> I often enforce two decimal places in my tables:
>
> #+TBLFM: @9$1=vsum(@-I..@-II);%0.2f
>
> https://orgmode.org/manual/Formula-syntax-for-Calc.html
>
> Can that help you with polar form?

Hi Russell,

I was initially hoping that there would be some kind of mode string that
would directly control this (perhaps something like `;I’ or `;J’ for
rectangular format, or `;P’ for polar format), but that isn't supported.
I don't quite see how to use your `;%f’ suggestion for this, though.
Can you elaborate?

I also tried messing around with org-calc-default-modes to no avail.

Thanks,

Rob.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Spreadsheet calc complex number display format
  2020-07-05 23:00 Spreadsheet calc complex number display format Rob Duncan
  2020-07-06  6:09 ` Russell Adams
@ 2020-07-07  0:59 ` Rob Duncan
  2020-07-07  3:57   ` Russell Adams
  1 sibling, 1 reply; 6+ messages in thread
From: Rob Duncan @ 2020-07-07  0:59 UTC (permalink / raw)
  To: emacs-orgmode

Rob Duncan <andapony@tabstopclear.org> writes:

> Is there a way to specify the display format used for complex number
> calculations in the table spreadsheet?  In particular I'd like to be
> able control whether a value is displayed in rectangular or polar form.

I ended up explicitly using the `polar(Z)' and `rect(Z)' functions in
the table formulae and I now get the display format I'm looking for.

Rob.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Spreadsheet calc complex number display format
  2020-07-07  0:59 ` Rob Duncan
@ 2020-07-07  3:57   ` Russell Adams
  2020-07-07 15:11     ` Rob Duncan
  0 siblings, 1 reply; 6+ messages in thread
From: Russell Adams @ 2020-07-07  3:57 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Jul 06, 2020 at 05:59:18PM -0700, Rob Duncan wrote:
> Rob Duncan <andapony@tabstopclear.org> writes:
>
> > Is there a way to specify the display format used for complex number
> > calculations in the table spreadsheet?  In particular I'd like to be
> > able control whether a value is displayed in rectangular or polar form.
>
> I ended up explicitly using the `polar(Z)' and `rect(Z)' functions in
> the table formulae and I now get the display format I'm looking for.

Rob, can you paste an example for others to reference later?


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Spreadsheet calc complex number display format
  2020-07-07  3:57   ` Russell Adams
@ 2020-07-07 15:11     ` Rob Duncan
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Duncan @ 2020-07-07 15:11 UTC (permalink / raw)
  To: emacs-orgmode

Russell Adams <RLAdams@AdamsInfoServ.Com> writes:

> On Mon, Jul 06, 2020 at 05:59:18PM -0700, Rob Duncan wrote:
>> Rob Duncan <andapony@tabstopclear.org> writes:
>>
>> > Is there a way to specify the display format used for complex number
>> > calculations in the table spreadsheet?  In particular I'd like to be
>> > able control whether a value is displayed in rectangular or polar form.
>>
>> I ended up explicitly using the `polar(Z)' and `rect(Z)' functions in
>> the table formulae and I now get the display format I'm looking for.
>
> Rob, can you paste an example for others to reference later?

Yep, here's one:

  | ! | A          | B          | R               | P                |
  |---+------------+------------+-----------------+------------------|
  | # | (1,1)      | (1,1)      | (0, 2)          | (2; 90.)         |
  | # | (1.414;45) | (1.414;45) | (0., 1.999396)  | (1.999396; 90)   |
  | # | (1,1)      | (1.414;45) | (0., 1.9996980) | (1.9996980; 90.) |
  | # | (1.414;45) | (1,1)      | (0., 1.9996980) | (1.9996980; 90.) |
  #+TBLFM: $4=rect($A*$B)::$5=polar($A*$B)

Rob.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-07 15:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 23:00 Spreadsheet calc complex number display format Rob Duncan
2020-07-06  6:09 ` Russell Adams
2020-07-06 21:25   ` Rob Duncan
2020-07-07  0:59 ` Rob Duncan
2020-07-07  3:57   ` Russell Adams
2020-07-07 15:11     ` Rob Duncan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).