| User: editor -- 2010-12-30 << 686 688 >> |
| Hits: 394 |
| Type: Text data calculation |
| Search all Text data calculation examples |
| Description: |
| How to calculate the area of triangles base on 3 sides automatically? There's a text file, there are 3 sides of a triangle in each line, how to get the area of each triangle? |
| Input Sample: |
| 3 4 5 7 5 8 9 12 7 12 9 18 6 10 8 |
| Output Sample: |
| Area of triangle with sides (3,4,5) is 6.00 Area of triangle with sides (7,5,8) is 17.32 Area of triangle with sides (9,12,7) is 31.30 Area of triangle with sides (12,9,18) is 47.99 Area of triangle with sides (6,10,8) is 24.00 |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
| We use the formula of heron: Assume the three sides are a,b,c Area=SQRT(p(p-a)(p-b)(p-c)), where p=(a+b+c)/2 or perimeter/2. 1. ctrl-o open source text file 2. ctrl-h open replace window * set 'replace unit' to 'Line' * set 'replace with pattern' to: * click 'Advanced' page, set 'Run following for each matched unit' to: 3. click 'replace', done. 4. ctrl-s save to file. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |