摘要
在MATLAB软件中实现多种渐变填充效果。构建微小四边形,根据填充区域轮廓特征在循环体内保持纵横坐标的函数关系,不断使轮廓矩阵发生改变并做微量平移,每移动1次就用fill函数填充(填充色和轮廓色值相等或取消轮廓色)之后填充色值发生微小增量改变,可实现线性渐变和路径渐变填充;在循环程序中,用plot函数在同一坐标位置重叠画逐渐减小的中心对称图形,填充色和轮廓色不断做相应改变,可实现锥角渐变、放射渐变等径向渐变填充。选择有实用价值的图形进行了实例验证。
Gradient filling effects can be achieved with MATLAB software.Based on the contour features of the filling area,a tiny quadrilateral is built,and the functional relationship between the vertical and horizontal coordinates is kept in the loop body.Accordingly,the contour matrix changes continually,and the quadrilateral keeps moving minutely.Once the quadrilateral moves,the function Fill is used to fill it(the fill color is the same as the outline color;or the outline color is set to“none”).Thus,the fill color value changes slightly to achieve the linear filling and path gradient filling.In a loop program,the function Plot is used to draw a centrosymmetric figure whose size gradually decreases coordinately,resulting in the correspondingly changing of the fill and outline color of the figure.Consequently,radial gradient(taper angle gradient or radiation gradient)filling could be achieved.Some useful graphs were selected for example verification.
作者
史文崇
SHI Wenchong(School of Mathematics and Information Science&Technology,Hebei Normal University of Science&Technology,Qinhuangdao Hebei,066004,China)
出处
《河北科技师范学院学报》
CAS
2020年第4期59-63,共5页
Journal of Hebei Normal University of Science & Technology