IOS作圖畫三角形,ios圖畫三角形

來源:互聯網
上載者:User

IOS作圖畫三角形,ios圖畫三角形
IOS作圖畫三角形by 伍雪穎


const CGFloat *color=CGColorGetComponents(popUpColor.CGColor);UIGraphicsBeginImageContext(CGSizeMake(30, 20));CGContextRef ctx = UIGraphicsGetCurrentContext();CGContextSetRGBFillColor(ctx, color[0], color[1], color[2], 1);CGContextSetShadowWithColor(ctx, CGSizeMake(0, 0), 7.0, [UIColor blackColor].CGColor);CGPoint points[3] = { CGPointMake(15, 20), CGPointMake(25, 0),    CGPointMake(5,0)};CGContextAddLines(ctx, points, 3);CGContextClosePath(ctx);CGContextFillPath(ctx);UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();



iOS怎使用程式畫三角形?

這段代碼能夠實現:-(void)drawRect:(CGRect)rect{ CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextBeginPath(ctx); CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); // top left CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMidY(rect)); // mid right CGContextAddLineToPoint(ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // bottom left CGContextClosePath(ctx); CGContextSetRGBFillColor(ctx, 1, 1, 0, 1); CGContextFillPath(ctx);} 到DEVDIV.COM網站查看回答詳情>>
 
怎用尺規作圖畫三角形的中線與高

某一條邊的中線畫法:以這條邊的一端為圓心,長度為半徑,畫個圓弧
以這條邊的另一端為圓心,長度為半徑,再畫個圓弧,
可以得到圓弧的兩個交點,串連兩個中點,就是這條邊的垂直平分線。
這條邊的中點也就找到了,串連中點和三角形的另一個點就是中線了

高的畫法:,三角形ABC中,AC<AB,以A為圓心,AC為半徑,作圓弧,交BC於D
作CD的垂直平分線,就是BC邊的高



 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.