Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. {px0, py0} = {1/5, 2/5}; {px1, py1} = {1/10, -2/5};{px4, py4} = {9/10, -3/10}; {px5, py5} = {6/5, 9/10};
  2.  
  3. g10 = ListLinePlot[{{px0, py0}, {px5, py5}}, PlotStyle -> {Thick, Blue}]; g11 = ListLinePlot[{{px1, py1}, {px4, py4}}, PlotStyle -> {Thick, Blue}];
  4.  
  5. points1 = {{px0, py0}, {px5, py5}};
  6.  
  7. points2 = {{px1, py1}, {px4, py4}};
  8.  
  9. g10 = Graphics[{Thick, Blue, Line[points1]}]; g11 =
  10. Graphics[{Thick, Blue, Line[points2]}];
  11.  
  12. poly = Graphics[{Lighter[Orange],
  13. Polygon[Join[points1, Reverse[points2]]]}];
  14.  
  15. Show[poly, g11, g10, PlotRange -> All, AspectRatio -> 1/GoldenRatio,
  16. Frame -> True]
  17.  
  18. l1 = {{px0, py0}, {px5, py5}};
  19. l2 = {{px1, py1}, {px4, py4}};
  20. ListLinePlot[{l1, l2}, PlotStyle -> Directive[Thick, Blue], Filling -> {1 -> {2}}]
  21.  
  22. l1 = {{px0, py0}, {px5, py5}};
  23. l2 = {{px1, py1}, {px4, py4}};
  24. l3 = {{px1 + 1/2, py1 + 1/2}, {px4 + 1/2, py4 + 1/2}};(*I just make it*)
  25.  
  26. filler1[list1__, list2__, col1_, col2_, lthick_] := Graphics[{col2, Opacity[0.75], Polygon[Join[list1, Reverse[list2]]], Thickness[lthick], col1, Opacity[1], Line[list1], Line[list2]}, Axes -> True]
  27.  
  28. filler2[list1__, list2__, col1_, col2_, lthick_] := Graphics[{col2, EdgeForm[{Thickness[lthick], col1}], Opacity[0.75], Polygon[Join[list1, Reverse[list2]]]}, Axes -> True]
  29.  
  30. (*lthick is the line thickness*)
  31.  
  32. plot1 = filler1[l1, l2, Blue, Gray, 0.02]
  33. plot2 = filler2[l1, l3, Green, Brown, 0.02]
  34. Show[plot1, plot2]
  35.  
  36. pts = {{1/5, 2/5}, {1/10, -2/5}, {9/10, -3/10}, {6/5, 9/10}};
  37.  
  38. RegionPlot[ConvexHullMesh[pts], AspectRatio -> 1/GoldenRatio]
  39.  
  40. l1 = {{px0, py0}, {px5, py5}};
  41. l2 = {{px1, py1}, {px4, py4}};
  42. ListLinePlot[ Join[{l1, l2},
  43. {Reverse@#, #2} & @@ Partition[Join[Reverse@l1, l2], 3, 2, {1, 1}]],
  44. PlotStyle -> {Directive[Thick, Blue], Directive[Thick, Red], None, None},
  45. Filling -> {3 -> {{4}, LightBlue}}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement