Method for zooming geometric figure
By obtaining the key point position information of the geometric figure and adjusting its collection, and redrawing the scaled geometric figure, the visual distortion problem caused by changes in line width after the geometric figure is scaled is solved, the stable scaling of the figure is achieved, and the teaching process is simplified.
Patent Information
- Application Number
- CN202411625887.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, after the geometric figure is scaled, the line width changes lead to visual distortion, affecting the teaching effect.
By obtaining the key point position information of the geometric figure, determining the scaling center and scale, adjusting the key point collection, and redrawing the geometric figure to achieve scaling.
Ensure that the width of the scaled graphic border lines remains consistent, avoid visual distortion, simplify the teaching process, and improve teaching efficiency.
Smart Images

Figure CN119515671A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of software technology, and in particular to a method for scaling geometric figures. Background Art
[0002] Most of the educational software currently available on the market has the function of drawing geometric figures, but it does not have the function of scaling or can only scale geometric figures using traditional scaling methods. In teaching scenarios, lecturers often need to scale geometric figures, but using traditional scaling methods, after users scale, the border lines of the figures will become very thick or very thin, and the overall appearance of the figures may change, resulting in visual distortion. This distortion may make the figure no longer accurately reflect its original shape and proportion visually, affecting the teaching effect. Summary of the invention
[0003] The purpose of the present invention is to provide a method for scaling geometric figures to solve the problem in the prior art that line width varies with the scaling of the figure, resulting in visual distortion and loss of details.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] A method for scaling a geometric figure comprises the following steps:
[0006] A. After the geometric figure is drawn, the position information of the key points of the geometric figure is obtained;
[0007] B. Determine the zoom center;
[0008] C. Get the scaling ratio;
[0009] D. Adjust the key point set in step A according to the scaling ratio and scaling center;
[0010] E. Redraw the geometry based on the set of key points adjusted in step D.
[0011] In some embodiments, the key points are points necessary for forming the geometric figure.
[0012] In some embodiments, the position information refers to the coordinate value of the required point in the rectangular coordinate system in the current operation interface.
[0013] In some embodiments, the key point set is stored in memory, and the set data is cleared when the geometric figure is deleted.
[0014] In some embodiments, the zoom center is preset and is the four corners or center position of the circumscribed rectangle of the geometric figure.
[0015] In some embodiments, the scaling factor is a fixed value or is obtained through dynamic calculation.
[0016] The beneficial effects that may be brought about by the method for scaling geometric figures disclosed in this application include but are not limited to:
[0017] The border lines of traditional graphics will change after scaling, resulting in inconsistent visual effects, and teachers often need to redraw a graphic to explain to students. However, the scaled graphics of the present invention will not have this problem, thereby simplifying the teaching process and improving teaching efficiency.
[0018] This application obtains the position information of the key points of the geometric figures generated by the user in the canvas, and stores the information in a point set in sequence. The zoom center is determined according to the position of the operation area or the pre-setting; when the user clicks the zoom operation area and slides on the canvas, the zoom ratio is calculated according to the sliding distance, and the key point set of the geometric figure is updated according to the calculated zoom ratio, and finally the zoom of the geometric figure is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of scaling geometric figures in an embodiment.
[0020] Figure 2 Schematic diagram of the operating points for scaling geometric figures in the embodiment.
[0021] Figure 3 It is a schematic diagram comparing the states before and after scaling the geometric figures in the embodiment. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present application more clear, the present application is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
[0023] On the contrary, the present application covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present application as defined by the claims. Further, in order to make the public have a better understanding of the present application, some specific details are described in detail in the detailed description of the present application below. Those skilled in the art can fully understand the present application without the description of these details.
[0024] A method for scaling geometric figures involved in an embodiment of the present application will be described in detail below. It should be noted that the following embodiments are only used to explain the present application and do not constitute a limitation on the present application.
[0025] like Figure 1-3 As shown, a method for scaling geometric figures comprises the following steps:
[0026] Step 1: When the user draws a geometric figure, obtain the position information of the key points of the geometric figure, and store the information in a key point set in sequence. The key point refers to the necessary point to form the geometric figure, which can be a mouse point, a touch point, etc. The position information refers to the coordinate value of the point in the rectangular coordinate system in the current operation interface. The key point set is saved in the memory, and when the geometric figure is deleted, the set data is cleared.
[0027] Step 2: Determine the zoom center and select the geometric figure. A rectangular selection box will appear on the geometric figure. The size of the selection box is exactly equal to the circumscribed rectangle of the geometric figure. There are four operating points at the four corners of the selection box. The zoom center corresponding to each operating point is its opposite corner. For example, the zoom center corresponding to the lower right corner operating point is the upper left corner of the circumscribed rectangle of the geometric figure.
[0028] Step 3: Get the scaling ratio. The scaling ratio is obtained by calculation. After the user presses the operation point in step 2 above, the scaling ratio is obtained by comparing the sliding distance with the original size of the geometric figure. The sliding distance can be a mouse sliding distance, a touch sliding distance, etc.
[0029] Step 4: According to the above zoom center and zoom ratio, adjust the key point set in step 1. Traverse the key point set, if the x coordinate or y coordinate of a point is equal to the x coordinate or y coordinate of the zoom center point, the equal coordinates remain unchanged; the unequal coordinates are multiplied by the zoom ratio to obtain the new coordinates.
[0030] According to the key point set adjusted in step 4, the geometric figure is redrawn and displayed on the interface, so as to obtain the scaled geometric figure.
[0031] Based on the above implementation scheme, users can scale geometric figures in the canvas by sliding the mouse or touching the figure without changing the border line width of the geometric figure, thereby ensuring consistent visual effects of the scaled figure and helping students understand the concepts and principles of graphic scaling more intuitively.
Claims
1. A method for scaling a geometric figure, characterized in that: The following steps are involved: A. After the geometric figure is drawn, the position information of the key points of the geometric figure is obtained; B. Determine the zoom center; C. Get the scaling ratio; D. Adjust the key point set in step A according to the scaling ratio and scaling center; E. Redraw the geometry based on the set of key points adjusted in step D.
2. A method for scaling geometric figures according to claim 1, characterized in that: The key points are points necessary for forming the geometric figure.
3. A method for scaling geometric figures according to claim 1, characterized in that: The position information refers to the coordinate value of the required point in the current operation interface in the rectangular coordinate system.
4. A method for scaling geometric figures according to claim 1, characterized in that: The key point set is stored in memory, and the set data is cleared when the geometric figure is deleted.
5. A method for scaling geometric figures according to claim 1, characterized in that: The scaling center is preset and is the four corners or center position of the circumscribed rectangle of the geometric figure.
6. A method for scaling geometric figures according to claim 1, characterized in that: The scaling ratio is a fixed value or is obtained through dynamic calculation.