直角三角形的斜边?

时间:2020-06-22 10:16:41

标签: javascript

我正在尝试制作一个直角三角形,其中斜边是一条由一条腿作为半径的曲线。有更好的方法吗?

shape

var can = document.getElementById('canvas1');
var ctx = can.getContext('2d');

ctx.fillStyle = "lightgray";
const p0 = { x: 0, y: 0  }
const p1 = { x: 80,  y: 20 }
const p2 = { x: 100,  y: 100  }

ctx.fillStyle = "lightgray";

ctx.beginPath();
ctx.moveTo(p0.x, p0.y);
ctx.arcTo(p1.x, p1.y, p2.x, p2.y, 100);
ctx.lineTo(p2.x, p2.y);
ctx.lineTo(0, 100)
ctx.lineTo(0, 0)
ctx.fill();
ctx.stroke();

1 个答案:

答案 0 :(得分:0)

DocumentSearchResult<AzureSearchItem> results = null;
ISearchFilterResult searchResult = DependencyResolver.Current.GetService<ISearchFilterResult>();
WriteToFile("Initiate request call for search result ProcessAzureSearch {0}");
results = searchServiceClient.Documents.Search<AzureSearchItem>(searchWord, parameters);
WriteToFile("Response received for search result {0}");
.quadrant {
  width: 100px;
  height: 100px;
  border-radius:0 100% 0 0;
  background-color: #f00;
}

您可以尝试使用border-radius CSS property