Skip to main content
Best answer by Werner_E

First you would determine the position where f(x) intersects with the horizontal.

And then you would just do the same twice using different theta limits..

Changed the approach slightly in the picture as I have added units.  It looks like Prime insists on NaN's having attached the appropriate unit, too - not really understandable.

As we use the same procedure now twice for Filla and Fillb, it sure would be a good idea to implement one of the hatch or fill functions from the other thread and using them twice or more.

Werner_E_0-1690362641460.png

 

 

2 replies

25-Diamond I
July 26, 2023

Currently there are two recent threads here with a quite similar question:

https://community.ptc.com/t5/Mathcad/How-to-fill-a-quadrilateral-with-color/td-p/888987/jump-to/first-unread-message

https://community.ptc.com/t5/Mathcad/How-to-fill-the-area-under-the-curve-with-colours/td-p/888777/jump-to/first-unread-message

You will find some ideas there and useful functions to shade in different ways.

 

Here is a very simple and basic method to fill your plot:

Werner_E_0-1690357590610.png

Attached the Prime 9 file and it will be the last file I look at with the name "untitled"!

 

8-Gravel
July 26, 2023

Thank you for your solution, and as you said i did found several similar posts but a bit hard to get into solution.

Also can you suggest any way to give different color to a and b.

 

Werner_E25-Diamond IAnswer
25-Diamond I
July 26, 2023

First you would determine the position where f(x) intersects with the horizontal.

And then you would just do the same twice using different theta limits..

Changed the approach slightly in the picture as I have added units.  It looks like Prime insists on NaN's having attached the appropriate unit, too - not really understandable.

As we use the same procedure now twice for Filla and Fillb, it sure would be a good idea to implement one of the hatch or fill functions from the other thread and using them twice or more.

Werner_E_0-1690362641460.png

 

 

25-Diamond I
July 26, 2023

One last remark:

Maybe a sine approximation is more appropriate than a spline interpolation!?

Werner_E_0-1690363299463.png