calculation syntax

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
User avatar
DaleEltoft
Active Member
Posts: 37
Joined: Tue Jun 29, 2021 1:23 am
Location: Creedmoor, NC USA

calculation syntax

Post by DaleEltoft » Sat Mar 18, 2023 4:41 pm

I've been using the ability to enter numbers as simple arithmetic with +-*/. Now I need to do powers and roots. If this is possible, where can I find documentation of the syntax?

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: calculation syntax

Post by petevick » Sat Mar 18, 2023 4:50 pm

there are a few snippets here that may help you - https://qcad.org/rsforum/viewtopic.php?t=3543
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

User avatar
andrew
Site Admin
Posts: 9052
Joined: Fri Mar 30, 2007 6:07 am

Re: calculation syntax

Post by andrew » Sat Mar 18, 2023 5:27 pm

The syntax is basic JavaScript, so for example Math.pow(3,2) and Math.sqrt(9) will work. However, in QCAD, for convenience, pow(3,2) and sqrt(9) also work.

See also:
https://qcad.org/doc/qcad/latest/refere ... ommandLine

User avatar
DaleEltoft
Active Member
Posts: 37
Joined: Tue Jun 29, 2021 1:23 am
Location: Creedmoor, NC USA

Re: calculation syntax

Post by DaleEltoft » Sat Mar 18, 2023 7:33 pm

Thanks

Post Reply

Return to “QCAD 'How Do I' Questions”