# Can I add Functions to Math?

I'd like to add a function to LO Math, specifically *arctan2(y,x)*, but in the menus I found no way to do this.

Is this even possible?

Thank You.

First time here? Check out the FAQ!

Can I add Functions to Math?

I'd like to add a function to LO Math, specifically *arctan2(y,x)*, but in the menus I found no way to do this.

Is this even possible?

Thank You.

2

If you need a new "function" in Math, just use

```
func newfuncname(x, y)
```

... which would format the argument of the `func`

keyword according to your formula's functions setting (same formatting as, say, `sin`

built-in function).

It seems that the `2`

is automatically considered an argument to the new function, and will be formatted as number (it's common to have things like `sin45°`

); so for `arctan2`

, you might need a workaround like

```
func arctan func2(y,x)
```

or, taking into account that `arctan`

is already a pre-existing function, and Math inserts a small gap between function name and argument, it might even be better to use this:

```
nospace {arctan func2}(y,x)
```

The keyword is present in the Math' `Functions`

section of `Elements`

pane:

See tdf#140726 which I filed for possible discoverability problem with this keyword.

0

OK, solved somehow.

Anyhow, it's all about layout, readability and aesthetics of formulas.

Entering the function as "arctan2" and choosing 'Format', 'Fonts..', 'Modify', 'Text' and choosing italic makes it look good.

Using a macro is somewhat over the top.

Math is a bit of a stepchild in LibreOffice, I think. But nice.

Asked: ** 2021-02-28 20:30:31 +0200 **

Seen: **64 times**

Last updated: **Mar 01**

arabic language support [closed]

Libreoffice math. no IME. Cannot edit formulas. [closed]

How can I get better quality in Math GIF images for HTML exports? [closed]

Can I export a document to LaTeX? [closed]

What could prevent the small formula window from working in LibO 3.5? [closed]

MATH The application does not appear below the edit window. [closed]

Del Operator in Libreoffice Math [closed]

is there something like quickbooks in libre office? [closed]

Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

This function is present in Calc. It is listed as ATAN2

I'm aware of this. But I'm talking about Math and adding it as a function to present formulas using it in a nice way.

Something is a bit munged with the forum here. Wanted to edit my comment or add a new one and couldn't mouse pointer moved a bit and hit the convert to answer link.

Yes you did say Math... Looks like you will have to build that function as a macro and call it that way.

Also has anyone else noticed that in the Math module of LO is called Formula in the File/New drop down menu?

Using LO 7.0.4.2 from opensuse 15.2.

Do you mean make

arctan2(y,x)to look like other functions, as in arctan2(y,x)? Put double quotes around it, "arctan2"(y,x)You would prolly want to make it look and work like a normal function would. I've not personally done this, but it should be possible with a macro. This will be a good start on macro writing https://duckduckgo.com/?t=ffab&q=libr...

Aren't the function ATAN2() and its name monsters anyway. All my life I worked with functions named without the usage of digits. Calc (or whoever) didn't a good job with that function giving it a name outside the usual namespace for functions. In addition AZAN2() is completely needless.

`Math`

shouldn't be blamed for "disliking" names with digits.Why are you talking about Calc? Riding some hobby horse here?

The question was related to Math.

For your reference:

https://en.wikipedia.org/wiki/Atan2

You're kidding? Of course I knew the question was about

`Math`

.However, a function named

`atan2`

(and its functionality) simply isn't known to me except for spreadsheets. Why should it be used in a`Math`

formula then? In mathematics the nearest related function would be`arg`

where the input which is a pair`(x, y)`

for the spreadsheet function would be the complex number`x + i y`

.`atan2`

/`arctan2`

is a well-known function distinct from`atan`

. The latter takes a single "tangent" argument (and has no way of knowing which half of plane is being meant), while the former takes two arguments (coordinates of a point on the tangent ray) to overcome this limitation of plain`atan`

. Distinguishing the two functions is very useful, and blaming others in wanting to use such things (based on something "isn't known to me") is ... strange. Besides,evenif it were used only in spreadsheets (which is not the case), why would someone not want to create, say, a tutorial for spreadsheet use with formulas created in Math? And should that someone give you account for their reasons?I see the distinguishing of inlined digits as a regression. This is the kind of "second guessing user intention" which is an important reason why I dislike MS Office.

I submitted an "un-enhancement request"