CFF Area and Perimeter Operations

설명

The plugin implements the “Area and Perimeter” operations module to be used from the equations of the “Calculated Fields Form” plugin. The “Calculated Fields Form” plugin is a form builder with a lot of potential, and its “Calculated” control is one of its great strengths. It allows you to enter mathematical formulas, determine the distance between addresses, plot graphs, process dates, manage files, and many other operations.

The “CFF Area and Perimeter Operations” plugin enhances, even more, the possibilities of the “Calculated Fields Form” plugin, including operations to calculate the area and perimeter of figures like squares, triangles, rhombus, circles, ellipse, and even more important, regular and irregular polygons. The Area and Perimeter operations included by the plugin are listed below:

NVERTICESAREA: Calculates the area of a 2D figure given its vertices. The vertices are pairs of x,y coordinates. The operation returns null if the parameters are invalid or insufficient.

Ex: NVERTICESAREA([4,10],[9,7],[11,2],[2,2]) Result: 45.5

NVERTICESPERIMETER: Calculates the perimeter of a 2D figure given its vertices. The vertices are pairs of x,y coordinates. The operation returns null if the parameters are invalid or insufficient.

Ex: NVERTICESPERIMETER([4,10],[9,7],[11,2],[2,2]) Result: 28.46

NSIDESAREA: Calculates the area of a 2D figure given its sides. The sides are numbers only. The operation returns null if the parameters are invalid or insufficient, or it is not a polygon. For irregular polygons the operations returns the maximum area.

Ex: NSIDESAREA(9,8,9,20) Result: 93.91

NSIDESPERIMETER: Calculates the perimeter of a 2D figure given its sides. The sides are numbers only. The operation returns null if the parameters are invalid or insufficient, or it is not a polygon.

Ex: NSIDESPERIMETER(9,8,9,20) Result: 46

SQUAREAREA: Calculates the area of a square. Accepts the side of the square as a parameter. The operation returns null if the parameter is not a number.

Ex: SQUAREAREA(9) Result: 81

SQUAREPERIMETER: Calculates the perimeter of a square. Accepts the side of the square as a parameter. The operation returns null if the parameter is not a number.

Ex: SQUAREPERIMETER(9) Result: 36

TRIANGLEAREA: Calculates the area of the triangle given its base and height. The operation returns null if the parameters are not numbers.

Ex: TRIANGLEAREA(4,5) Result: 10

TRIANGLEPERIMETER: Calculates the perimeter of the triangle given two or three sides. If you pass only two sides as parameters, the plugin assumes it is a right triangle and calculates its hypotenuse. The operation returns null if the parameters are not numbers.

Ex: TRIANGLEAREA(3,4) Result: 12
Ex: TRIANGLEAREA(3,4,5) Result: 12

RHOMBUSAREA: Calculates the area of a rombo given its diagonals. The operation returns null if the parameters are not numbers.

Ex: RHOMBUSAREA(3,4) Result: 6

RHOMBUSPERIMETER: Calculates the perimeter of a rombo area given its side or diagonals. If you pass two parameters to the RHOMBUSPERIMETER operation, it assumes they are the rombo diagonals. The operation returns null if the parameters are not numbers.

Ex: RHOMBUSPERIMETER(6,8) Result: 20
Ex: RHOMBUSPERIMETER(5) Result: 20

ELLIPSEAREA: Calculates the area of an ellipse given two semi-axis. The operation returns null if the parameters are not numbers.

Ex: ELLIPSEAREA(7,5) Result: 109.96

ELLIPSEPERIMETER: Calculates the perimeter of an ellipse given two semi-axis. The operation returns null if the parameters are not numbers.

Ex: ELLIPSEPERIMETER(2,3) Result: 16.02

CIRCLEAREA: Calculates the area of a circle given its radius. The operation returns null if the parameter is not a number.

Ex: CIRCLEAREA(3) Result: 28.27

CIRCLEPERIMETER: Calculates the perimeter of a circle given its radius. The operation returns null if the parameter is not a number.

Ex: CIRCLEPERIMETER(3) Result: 18.85

Use

The “CFF Area and Perimeter Operations” plugin includes the new “Area and Perimeter” entry (see screenshots) in the operations list of the calculated fields (Insert a calculated field in the form and scroll down the operations list in your configuration). Once the “Area and Perimeter” option is selected, the plugin enables the operations set and documentation. By clicking on the operation buttons, they are added to the equation’s editor.

스크린샷

  • Area and Perimeter operations list item
  • Area and Perimeter operations buttons
  • Equations editor and operation documentation

설치

To install the “CFF Area and Perimeter Operations” plugin:

  • Go to the Plugins section on your WordPress.
  • Press the “Add New” button at the top of the Plugins section (or WordPress submenu).
  • Enter the “CFF Area and Perimeter Operations” into the search box.
  • Press the corresponding “Install” button.
  • And finally, press the “Activate” one.

후기

2023년 1월 17일
The most impressive feature of the “CFF Area and Perimeter Operations” plugin (for Calculated Fields Form) is the possibility of calculating areas of irregular polygons.
모든 0 평가 읽기

기여자 & 개발자

“CFF Area and Perimeter Operations”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “CFF Area and Perimeter Operations”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

1.0.2

  • Resolves a notice by ensuring the language files are properly loaded.

1.0.1

  • Modifies the operations NSIDESAREA, NSIDESPERIMETER, TRIANGLEPERIMETER, and RHOMBUSPERIMETER for accepting sides array as argument.

1.0.0

  • First version released.