An electronic whiteboard line drawing method, an electronic whiteboard and a storage medium
By obtaining the endpoints of the target line on the electronic whiteboard, determining the curve that meets the preset conditions, and fitting the transition curve, the problem of inaccurate curve connection is solved, and a better drawing effect is achieved.
Patent Information
- Application Number
- CN202211714875.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-12-29
AI Technical Summary
When using an interactive whiteboard for math teaching, the connection between two curves cannot be made smoothly and accurately, failing to achieve the user's drawing intention.
By obtaining the endpoints of the target line, a first curve that meets the preset conditions is determined, and a transition curve is fitted based on the target point set to achieve a smooth connection between the curve and the target line; for a straight line, the target line is adjusted to be tangent to the tangent line.
It achieves a smooth connection between curves and lines, which meets the user's drawing intentions and improves teaching effectiveness and drawing accuracy.
Smart Images

Figure CN116051674B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic whiteboard technology, and in particular to an electronic whiteboard line drawing method, an electronic whiteboard, and a storage medium. Background Technology
[0002] Traditional whiteboards use markers and erasers for writing and erasing, facilitating discussions and instruction. However, traditional whiteboard teaching systems have drawbacks such as the inability to digitize information, difficulty in storing information, and difficulty in sharing information. Therefore, electronic whiteboards have become increasingly popular in recent years.
[0003] An interactive whiteboard is a high-tech product that integrates cutting-edge electronic and software technologies. Combined with a computer and projector, an interactive whiteboard enables paperless office and teaching. It allows writing directly on the whiteboard, just like a regular whiteboard or blackboard, and the information is then transferred to a computer. Compared to projectors and traditional whiteboards, interactive whiteboards offer advantages such as speed and convenient data storage.
[0004] However, in the process of using interactive whiteboards for mathematics teaching, when teachers draw various curves on the whiteboard, the connection between two curves is often not drawn accurately, failing to achieve the user's drawing intention. Therefore, how to smoothly connect the joints of two curves is a problem that needs to be solved. Summary of the Invention
[0005] This application provides a method for drawing lines on an electronic whiteboard, an electronic whiteboard, and a storage medium for smoothly connecting the parts where two curves meet.
[0006] To achieve the above technical objectives, this application adopts the following technical solution:
[0007] In a first aspect, embodiments of this application provide a method for drawing lines on an electronic whiteboard, the method comprising:
[0008] Obtain the latest target line drawn by the user from the multiple lines currently displayed on the electronic whiteboard;
[0009] When the target line is a curve, based on the first endpoint of the target line, the curve whose endpoints satisfy the first preset condition among multiple lines is determined as the first curve; the first endpoint is any one of the endpoints of the target line, and the first curve is a different line from the target line.
[0010] The target point set is determined based on the target line and the first curve. The target point set includes the first endpoint, several points near the first endpoint on the target line, the second endpoint of the first curve, and several points near the second endpoint on the first curve. The second endpoint is the endpoint of the first curve that satisfies the first preset condition.
[0011] The points in the target point set are fitted into a transition curve that connects the target line and the first curve.
[0012] The technical solution provided by this application brings at least the following beneficial effects: based on the first endpoint of the target line and the first preset condition, the user's drawing intention is understood, the first curve that the user wants to fit and connect with the target line is determined, and then the target point set is determined based on the second endpoint of the first curve and the first endpoint of the target line, thereby fitting a transition curve based on the target point set, realizing a smooth connection between the first curve and the target line, and obtaining a curve drawing effect that better matches the user's drawing intention.
[0013] In one possible implementation, determining the target point set based on the target line and the first curve includes: determining a first preset point from the first curve; determining a first preset number of abscissas from the abscissa interval between the second endpoint and the first preset point, and determining a first preset number of points on the first curve based on the first preset number of abscissas; or, determining a first preset number of ordinates from the ordinate interval between the second endpoint and the first preset point, and determining a first preset number of points on the first curve based on the first preset number of ordinates; determining the target point set based on the target line and the first curve further includes: determining a second preset point from the target line; determining a second preset number of abscissas from the abscissa interval between the first endpoint and the second preset point, and determining a second preset number of points on the target line based on the second preset number of abscissas; or, determining a second preset number of ordinates from the ordinate interval between the first endpoint and the second preset point, and determining a second preset number of points on the target line based on the second preset number of ordinates; and determining the first preset number of points and the second preset number of points as the target point set. In this way, based on the second endpoint of the first curve that meets the first preset condition, a first preset number of points are determined on the first curve. Based on the first endpoint of the target line that meets the first preset condition, a second preset number of points are determined on the target line. Then, based on the first preset number of points and the second preset number of points, a target point set is obtained. By fitting the points in the target point set, a transition curve that smoothly connects the first curve and the target line can be obtained.
[0014] In one possible implementation, the first preset condition includes: the distance between the target point set and the first endpoint is minimized and less than a first preset distance; fitting the points in the target point set into a transition curve connecting the target line and the first curve includes: fitting the points in the target point set according to multiple preset fitting functions to obtain multiple fitted curves; and using the fitted curve with the highest fitting degree among the multiple fitted curves as the transition curve connecting the target line and the first curve. In this way, by setting the first preset distance, the user's drawing intention can be accurately understood, determining whether the user wants to connect the two curves. Then, based on the minimum distance between the endpoints of the multiple curves and the first endpoint, the first curve is determined, i.e., the curve that needs to be fitted and connected to the target line. The connection between the target line and the first curve is then fitted and connected to obtain a better drawing effect. By quickly fitting the points in the target point set according to the preset fitting function, the transition curve can be determined quickly and accurately.
[0015] In one possible implementation, before obtaining the latest target line drawn by the user from the multiple lines currently displayed on the electronic whiteboard, the method further includes: receiving the drawing trajectory input by the user on the electronic whiteboard; and, if the drawing trajectory represents a curve, fitting multiple drawing points constituting the drawing trajectory to obtain the target line. In this way, by fitting multiple drawing points constituting the drawing trajectory to obtain a fitted target line, a more accurate line that better matches the user's drawing intention is obtained, providing the user with a more satisfactory drawing experience.
[0016] In one possible implementation, the method further includes: when the target line is a straight line, identifying a curve whose shortest distance from points on multiple lines to the target line satisfies a second preset condition as a second curve, wherein the second curve is a different line from the target line; and moving the target line to be tangent to the second curve. By setting the second preset condition, it is possible to determine whether the user wants to draw the tangent of a certain curve, thereby accurately understanding the user's drawing intention, determining the second curve that the user wants to be tangent to the target line, and then adjusting the target line to be tangent to the second curve, resulting in a more accurate drawn line and achieving better teaching results.
[0017] In one possible implementation, the second preset condition includes: the shortest distance from the point to the target line is the smallest and less than the second preset distance; moving the target line to be tangent to the second curve includes: if a coordinate axis is displayed on the electronic whiteboard and one endpoint of the target line is located on the coordinate axis, determining the tangent line among the multiple tangent lines of the second curve that passes through the starting point of the target line as the target tangent line, and the intersection point of the second curve and the target tangent line as the target tangent point; rotating the target line with the endpoint of the target line located on the coordinate axis as the rotation center until the target line is tangent to the second curve at the target tangent point; or, if a coordinate axis is displayed on the electronic whiteboard and the starting point of the target line is not on the coordinate axis, or if no coordinate axis is displayed on the electronic whiteboard, determining the point on the second curve with the smallest shortest distance to the target line as the target tangent point; translating the target line until the target line is tangent to the second curve at the target tangent point. In this way, by setting the second preset distance, the user's drawing intention can be accurately understood, determining whether the user wants to draw the tangent of a certain curve. Then, based on the minimum shortest distance from a point on the curve to the target line, the second curve—that is, the curve that might be tangent to the target line—is determined. The target line can then be adjusted to achieve a better drawing effect. When the electronic whiteboard displays a coordinate axis, and the first endpoint of the target line is located on the coordinate axis, it indicates that the user wants to draw the tangent of the second curve from a fixed point on the coordinate axis. Therefore, when adjusting the position of the target line, it should be ensured that the target line always passes through this fixed point, and the final display effect better matches the user's drawing intention. When the first endpoint of the target line is not on the coordinate axis, it indicates that the target line does not pass through a fixed point. The slope of the target line is the slope of the tangent of the second curve. Simply translate the target line until it is tangent to the second curve. The process for handling the target line is simpler, and the effect of the target line being tangent to the second curve can still be obtained, matching the user's drawing intention.
[0018] Secondly, this application provides another method for drawing lines on an electronic whiteboard. The method includes: obtaining the latest target line drawn by the user from multiple lines currently displayed on the electronic whiteboard; if the target line is a straight line, determining the curve whose shortest distance from points on multiple lines to the target line satisfies a preset condition as the target curve, wherein the target curve and the target line are different lines; and moving the target line to be tangent to the target curve.
[0019] Thirdly, this application provides an electronic whiteboard. The electronic whiteboard includes modules for performing the methods described in the first aspect or any possible design of the first aspect.
[0020] Fourthly, this application provides an electronic whiteboard, comprising: one or more processors; one or more memory; wherein the one or more memory is used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the electronic whiteboard executes any of the electronic whiteboard line drawing methods provided in the first aspect above.
[0021] Fifthly, this application provides a computer-readable storage medium storing computer-executable instructions that, when executed on a computer, cause the computer to perform any of the electronic whiteboard line drawing methods provided in the first aspect.
[0022] Sixthly, this application provides a computer program product including computer instructions that, when executed on an electronic whiteboard, cause the electronic whiteboard to perform the electronic whiteboard line drawing method as described in the first aspect and any possible design of the application.
[0023] For a detailed description of aspects two through six and their various implementations in this application, please refer to the detailed description in aspect one and its various implementations; and for a detailed description of the beneficial effects of aspects two through six and their various implementations, please refer to the beneficial effect analysis in aspect one and its various implementations, which will not be repeated here.
[0024] These or other aspects of this application will become more readily apparent in the following description. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the structure of an electronic whiteboard provided in an embodiment of this application;
[0026] Figure 2 This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 1 ;
[0027] Figure 3 The flowchart of an electronic whiteboard line drawing method provided in this application embodiment Figure 1 ;
[0028] Figure 4 This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 2 ;
[0029] Figure 5 The flowchart of an electronic whiteboard line drawing method provided in this application embodiment Figure 2 ;
[0030] Figure 6This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 3 ;
[0031] Figure 7 This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 4 ;
[0032] Figure 8 This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 5 ;
[0033] Figure 9 This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 6 ;
[0034] Figure 10 This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 7 ;
[0035] Figure 11 This application scenario illustrates an electronic whiteboard line drawing method provided in this embodiment. Figure 8 ;
[0036] Figure 12 This is a schematic diagram of another electronic whiteboard provided in an embodiment of this application;
[0037] Figure 13 This is a schematic diagram of the structure of another electronic whiteboard provided in the embodiments of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0040] Traditional whiteboards use markers and erasers for writing and erasing, facilitating discussions and instruction. However, traditional whiteboard teaching systems have drawbacks such as the inability to digitize information, difficulty in storing information, and difficulty in sharing information. Therefore, electronic whiteboards have become increasingly popular in recent years.
[0041] An interactive whiteboard is a high-tech product that integrates cutting-edge electronic and software technologies. Combined with a computer and projector, an interactive whiteboard enables paperless office and teaching. It allows writing directly on the whiteboard, just like a regular whiteboard or blackboard, and the information is then transferred to a computer. Compared to projectors and traditional whiteboards, interactive whiteboards offer advantages such as speed and convenient data storage.
[0042] However, in the process of using interactive whiteboards for mathematics teaching, when teachers draw various curves on the whiteboard, the connection between two curves is often not drawn accurately, failing to achieve the user's drawing intention. Therefore, how to smoothly connect the joints of two curves is a problem that needs to be solved.
[0043] In response, this application provides a method for drawing lines on an electronic whiteboard. Based on the first endpoint of the target line and a first preset condition, a first curve is determined. Then, based on the second endpoint of the first curve and the first endpoint of the target line, a target point set is determined. Finally, a transition curve between the first curve and the second curve is fitted based on the target point set, so that the first curve and the target line can be smoothly connected, achieving a better drawing effect.
[0044] Please refer to Figure 1 This illustrates a schematic diagram of the electronic whiteboard to which the electronic whiteboard line drawing method provided in this application is applicable. For example... Figure 1 As shown, the electronic whiteboard 10 may include a display device 101, a touch device 102, and a controller 103. The controller 103 is connected to the display device 101 and the touch device 102.
[0045] In one example, the touch device 102 can be disposed on the surface of the display device 101, that is, the display device 101 and the touch device 102 are integrated together, and the electronic whiteboard 10 is a touch display all-in-one machine.
[0046] In another example, the touch device 102 and the display device 101 are separate devices; that is, the electronic whiteboard 10 is a separate touch and display device. The touch device 102 and the display device 101 can be connected via wired (such as Universal Serial Bus (USB) or Type-C) or wireless (such as Bluetooth or Wireless-Fidelity (Wi-Fi)).
[0047] In some embodiments, the touch device 102 is used to receive a user's writing operation on the touch device 102 via a finger or other writing device, thereby determining the lines drawn by the user on the touch device 102.
[0048] In some embodiments, the display device 101 is used to display lines drawn by the user. The display device 101 may be a liquid crystal display or an organic light-emitting diode (OLED) display. The specific type, size, and resolution of the display are not limited, and those skilled in the art will understand that the display can be modified in terms of performance and configuration as needed.
[0049] In some embodiments, the touch device 102 includes a writing area and a function control area. For example, such as Figure 2 As shown, the function control area includes multiple drawing function controls, such as "line color", "line thickness", "insert image", "line connection fitting", and "tangent fitting". Users can draw lines in the writing area, select whether to enable the "line connection fitting" and "tangent fitting" functions in the function control area, and set information such as line color and thickness.
[0050] In some embodiments, if the user enables the "line connection fitting" function, when the target line is a curve, the controller 103 determines the transition curve between the target line and the first curve, and displays the transition curve between the target line and the first curve, so that the target line and the first curve are smoothly connected. First, the controller 103 obtains the latest target line drawn by the user from the multiple lines currently displayed on the electronic whiteboard 10. Based on the first endpoint of the target line, the curve whose endpoints satisfy the first preset condition among the multiple lines is determined as the first curve. Then, based on the target line and the first curve, a target point set is determined, and the points in the target point set are fitted into a transition curve connecting the target line and the first curve. The target point set includes the first endpoint, several points near the first endpoint on the target line, the second endpoint of the first curve, and several points near the second endpoint on the first curve. The second endpoint is the endpoint of the first curve that satisfies the first preset condition. The first endpoint is any endpoint of the target line, and the first curve and the target line are different lines.
[0051] In some embodiments, if the user enables the "tangent fitting" function, and the target line is a straight line, the controller 103 will also determine the curve whose shortest distance from the midpoint of multiple lines drawn by the user to the target line satisfies the second preset condition as the second curve. Then, based on the target line and the second curve, the controller will move the target line until it is tangent to the second curve. Here, the target line is the line most recently drawn by the user, and the second curve is a different line from the target line.
[0052] In some embodiments, controller 103 refers to a device that can generate operation control signals based on instruction opcodes and timing signals to instruct the electronic whiteboard 10 to execute control instructions. Exemplarily, controller 103 can be a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. Controller 103 can also be other devices with processing functions, such as circuits, devices, or software modules; this application embodiment does not impose any limitations on this.
[0053] In some embodiments, the electronic whiteboard 10 described above may also be an electronic whiteboard including a display screen. For example, the electronic whiteboard may have application software installed, through which the functions of the electronic whiteboard can be implemented. The application software including the electronic whiteboard may be a teaching application that supports multi-person interaction, remote collaboration, and other scenarios. The electronic whiteboard may be a product with touch functionality, such as a computer, mobile phone, or tablet computer.
[0054] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0055] The electronic whiteboard line drawing method provided in this application embodiment can be executed by the controller 103 in the electronic whiteboard 10.
[0056] like Figure 3 As shown in the figure, this application provides a method for drawing lines on an electronic whiteboard, which includes the following steps:
[0057] S101. Obtain the latest target line drawn by the user from the multiple lines currently displayed on the electronic whiteboard.
[0058] In some embodiments, before obtaining the latest target line drawn by the user from the multiple lines currently displayed on the electronic whiteboard, the controller receives the drawing trajectory input by the user on the electronic whiteboard, and if the drawing trajectory represents a curve, fits multiple drawing points constituting the drawing trajectory to obtain the target line.
[0059] Specifically, the controller can approximate discrete data using analytical expressions or by fitting multiple drawing points constituting the drawing trajectory using the least squares method (also known as the least squares method) to obtain the fitted target line. This application does not specifically limit the specific fitting method.
[0060] As an example, the multiple drawing points that constitute the drawing trajectory can be determined from the lines drawn by the user at preset time intervals.
[0061] In another example, the multiple drawing points that constitute the drawing trajectory can also be determined from the lines drawn by the user according to preset coordinate intervals.
[0062] In this way, the controller fits multiple drawing points that constitute the drawing trajectory to obtain the fitted target line. Based on the user's drawing intention, a more accurate line that better matches the user's drawing intention is obtained, bringing the user a more satisfactory drawing experience.
[0063] In some embodiments, after detecting a pause in the user's line drawing, the controller assumes the user has finished drawing and fits the user-drawn line. If the user has enabled the "line connection fitting" function, after fitting the user-drawn line, the controller determines the first curve that needs to be fitted to the target line, and fits and connects the connection between the first curve and the target line.
[0064] S102. When the target line is a curve, based on the first endpoint of the target line, the curve whose endpoints satisfy the first preset condition among multiple lines is determined as the first curve.
[0065] Wherein, the first endpoint is any endpoint of the target line, and the first curve is a different line from the target line.
[0066] In some embodiments, the first preset condition includes: the distance between the first endpoint and the first endpoint is minimized, and is less than a first preset distance. For example, such as... Figure 4 As shown, the user has drawn curves a, b, c, and d on the electronic whiteboard. The latest target line drawn by the user is curve d. Taking the left endpoint of curve d as an example, when the left endpoint of curve d is taken as the center and the first preset distance is taken as the radius, it can be seen that the distances between the two endpoints of curve a and the left endpoint of curve d are both greater than the first preset distance. The distance between one endpoint of curve b and the left endpoint of curve d is x1, and the distance between one endpoint of curve c and the left endpoint of curve d is x2. Since x1 < x2, and both x1 and x2 are less than the first preset distance, it indicates that the distance between the left endpoint of curve d and one endpoint of curve b is the shortest. The user is more likely to want to connect curve b and curve d, so curve b can be determined as the first curve.
[0067] In this way, by setting the first preset distance, the user's drawing intention can be accurately understood, and it can be determined whether the user wants to connect two curves. Then, based on the minimum distance between the endpoints of multiple curves and the first endpoint, the first curve is determined, which is the curve that needs to be fitted and connected to the target line. Then, the connection between the target line and the first curve is fitted and connected to obtain a better drawing effect.
[0068] S103. Determine the target point set based on the target line and the first curve.
[0069] The target point set includes the first endpoint, several points near the first endpoint on the target line, the second endpoint of the first curve, and several points near the second endpoint on the first curve. The second endpoint is the endpoint of the first curve that satisfies the first preset condition.
[0070] In some embodiments, the controller can determine a first preset point from a first curve, determine a first preset number of abscissas from the abscissa interval between the second endpoint and the first preset point, and determine a first preset number of points on the first curve based on the first preset number of abscissas; or, determine a first preset number of ordinates from the ordinate interval between the second endpoint and the first preset point, and determine a first preset number of points on the first curve based on the first preset number of ordinates. A second preset point is determined from a target line, a second preset number of abscissas are determined from the abscissa interval between the first endpoint and the second preset point, and a second preset number of points on the target line based on the second preset number of abscissas; or, determine a second preset number of ordinates from the ordinate interval between the first endpoint and the second preset point, and determine a second preset number of points on the target line based on the second preset number of ordinates; thereby determining the first preset number of points and the second preset number of points as a target point set.
[0071] The first preset quantity and the second preset quantity can be the same or different, and this application embodiment does not impose specific restrictions on this.
[0072] For example, the controller establishes a Cartesian coordinate system, the origin of which can be located at the center of the writing area on the electronic whiteboard, and the fitting function for the target line is y = x. 3 The coordinates of the two endpoints of the target line are The fitting function for the first curve is y = e (5, 125). x The coordinates of the two endpoints of the first curve are (0, 1) and (-5, e). -5 If the first endpoint of the target line that meets the first preset condition is..., then the coordinates of the first endpoint are... The coordinates of the second endpoint of the first curve that meets the first preset condition are (0, 1).
[0073] The coordinates of the first preset point are determined from the first curve as (-1, e). -1 If the first preset quantity is 30, then the interval [-1, 0] can be evenly divided into 29 parts, resulting in 30 abscissa values. Then, based on the fitting function of the first curve, 30 points, including the first preset point and the second endpoint, can be determined. Alternatively, the interval [e...] can be divided into... -1 [1] is evenly divided into 29 parts to obtain 30 ordinate values. Then, based on the fitting function of the first curve, 30 points including the first preset point and the second endpoint are determined.
[0074] The coordinates of the second preset point on the target line are determined to be (1, 1), and the second preset quantity is 20. Then the interval can be... The interval is evenly divided into 19 parts, resulting in 20 abscissa values. Then, based on the fitting function of the target line, 20 points are determined, including the second preset point and the first endpoint. Alternatively, the interval can be divided into... The data is divided into 19 equal parts to obtain 20 ordinate values. Then, based on the fitting function of the target line, 20 points, including the second preset point and the first endpoint, are determined.
[0075] In this way, the controller determines a second preset number of points on the target line based on the first endpoint of the target line that meets the first preset condition, and determines a first preset number of points on the first curve based on the second endpoint of the first curve that meets the first preset condition, thereby obtaining a target point set. By fitting the points in the target point set, a transition curve that smoothly connects the first curve and the target line can be obtained.
[0076] S104. Fit the points in the target point set into a transition curve that connects the target line and the first curve.
[0077] In some embodiments, step S104 can be specifically implemented as follows: the controller fits the points in the target point set according to multiple preset fitting functions to obtain multiple fitting curves; the fitting curve with the highest fitting degree among the multiple fitting curves is used as the transition curve for connecting the target line and the first curve.
[0078] For example, the controller stores multiple preset fitting functions in advance. After obtaining the target point set, the points in the target point set are substituted into the multiple preset fitting functions respectively. The preset fitting function with the highest degree of overlap with the points in the target point set is used as the fitting function of the transition curve, thereby determining the transition curve.
[0079] In this way, the controller can quickly fit the points in the target point set according to the preset fitting function, thereby quickly and accurately determining the transition curve.
[0080] Figure 3 The technical solution shown brings at least the following beneficial effects: based on the first endpoint of the target line and the first preset condition, the user's drawing intention is understood, the first curve that the user wants to fit and connect with the target line is determined, and then the target point set is determined based on the second endpoint of the first curve and the first endpoint of the target line. A transition curve is then fitted based on the target point set to achieve a smooth connection between the first curve and the target line, resulting in a curve drawing effect that better matches the user's drawing intention.
[0081] In some embodiments, such as Figure 5 As shown in the embodiment of this application, another method for drawing lines on an electronic whiteboard is also provided, including the following steps:
[0082] S201. When the target line is a straight line, the curve whose shortest distance from multiple points on the line to the target line satisfies the second preset condition is determined as the second curve.
[0083] The second curve is a different line from the target line.
[0084] In some embodiments, the second preset condition includes: the shortest distance from the point to the target line is the smallest and is less than the second preset distance.
[0085] For example, such as Figure 6 As shown, the user has drawn curves m, n, and a straight line l on the electronic whiteboard. The target line drawn by the user is straight line l. The controller determines the minimum distance s1 from a point on curve m to straight line l, and the minimum distance s2 from a point on curve n to straight line l, based on the fitting functions of curves m, n, and l. Since s1 < s2, and both s1 and s2 are less than a second preset distance, it indicates that the distance between straight line l and curve m is closer, and straight line l is more likely to be a tangent to curve m. Therefore, curve m can be determined as the second curve.
[0086] In this way, by setting the second preset distance, the user's drawing intention can be accurately understood, and it can be determined whether the user wants to draw the tangent of a certain curve. Then, based on the minimum value of the shortest distance from the point on the curve to the target line, the second curve, that is, the curve that may be tangent to the target line, can be determined, and the target line can be adjusted to obtain a better drawing effect.
[0087] There are two methods for calculating the shortest distance from a point on a curve to a straight line: the conditional substitution method and the unconditional extremum method for multivariable functions. Taking the unconditional extremum method for multivariable functions as an example, if the distance from a point on the curve to the straight line is the minimum among all distances from points on the curve to the straight line, then the tangent line at that point on the curve is parallel to the straight line. For example, ... Figure 7 As shown, point A lies on the function curve g(x) = x 3 Moving upwards, point B lies on the function curve f(x) = e 2x Move upwards. From geometric knowledge, we know that when the distance between points A and B is minimized, the tangent line at point A on curve g is parallel to the tangent line at point B on curve f. Assuming the coordinates of point A are (a, g(a)) and the coordinates of point B are (b, f(b)), then f′(b) = g′(a), resulting in 2exp(2b) = 3b. 2 Therefore, b can be represented by a, that is... Therefore, the sum of the squares of the shortest distances between points A and B can be expressed as d = According to the unconditional extremum method for multivariable functions, the minimum value of the shortest distance between points A and B is... The point where the derivative is 0 is a local minimum. The derivative of is It can be seen that a = 1 is a maximum value, so it is discarded. The value of 'a' is the minimum point, and we find that a = -0.432516178528808. Therefore, the shortest distance between point A and point B can be calculated as...
[0088] If the distance between a point (a, g(a)) on curve g(x) and a point (b, f(b)) on curve f(x) is minimized, the problem of minimizing distance can also be transformed into a problem involving two variables. The problem of finding the minimum value of a bivariate function. A necessary condition for the existence of an extremum of a bivariate function is that the partial derivatives of the bivariate function are zero. This can be solved by finding the minimum value of the bivariate function. The points (a0, g(a0)) and (b0, f(b0)) where the partial derivatives of a bivariate function are zero can be calculated using tools such as MATLAB. A sufficient condition for the existence of extrema of a bivariate function is... Verifying the calculated a0 and b0, the minimum value of h is found to be 0.4145564808646899.
[0089] S202, Move the target line until it is tangent to the second curve.
[0090] In some embodiments, when a coordinate axis is displayed on the electronic whiteboard and one endpoint of the target line is located on the coordinate axis, the tangent line that passes through the starting point of the target line among the multiple tangent lines of the second curve is determined as the target tangent line, and the intersection point of the second curve and the target tangent line is the target tangent point; with the endpoint of the target line located on the coordinate axis as the rotation center, the target line is rotated until the target line is tangent to the second curve at the target tangent point.
[0091] For example, such as Figure 8 As shown, the fitting function for the target line is y = x + 1, the coordinates of the first endpoint of the target line are (0, 1), and the fitting function for the second curve is y = -x. 2 +4x-1, assuming the coordinates of the target tangent point between the target line and the second curve after the movement are (x0, y0), then the equation of the tangent line to the second curve at the target tangent point is y-(-x0). 2 Given y = (-2x0 + 4)(x - x0), we know that the tangent line passes through the point (0, 1). Substituting (0, 1) into the tangent line equation y = (-2x0 + 4)(x - x0), we can see that the tangent line passes through the point (0, 1). 2 In the expression (x - x0) = (-2x0 + 4)(x - x0), we can find... or (Discarded), that is, the coordinates of the target tangent point are Therefore, the equation of the tangent line at the target tangent point can be obtained as follows: Therefore, rotate the target line around the point (0, 1) until it is aligned with the straight line. If they overlap, then... Figure 9 As shown, the target line is tangent to the second curve at the target tangency point.
[0092] Since the electronic whiteboard displays a coordinate axis, and the first endpoint of the target line is located on the coordinate axis, it indicates that the user wants to draw the tangent of the second curve from a fixed point on the coordinate axis. Therefore, when adjusting the position of the target line, it should be ensured that the target line always passes through this fixed point, and the final display effect is more in line with the user's drawing intention.
[0093] In some embodiments, if a coordinate axis is displayed on the electronic whiteboard and the starting point of the target line is not on the coordinate axis, or if a coordinate axis is not displayed on the electronic whiteboard, the point on the second curve with the smallest shortest distance to the target line is determined as the target tangent point; the target line is translated until the target line is tangent to the second curve at the target tangent point.
[0094] For example, such as Figure 10 As shown, the fitting function for the target line is y = x + 1, but the coordinate axes are not displayed on the electronic whiteboard. The fitting function for the second curve is y = -x. 2 +4x-1, assuming the coordinates of the target tangent point between the target line and the second curve after the movement are (x0, y0), then the equation of the tangent line to the second curve at the target tangent point is y-(-x0). 2 Given (+4x0-1)=(-2x0+4)(x-x0), we know the slope of this tangent line is 1. Therefore, we can find... That is, the coordinates of the target tangent point are Therefore, the equation of the tangent line at the target tangent point can be obtained as follows: Therefore, the target line is shifted to the point of tangency with the target. If they overlap, then... Figure 11 As shown, the target line is tangent to the second curve at the target tangency point.
[0095] Since the first endpoint of the target line is not on the coordinate axis, it means that the target line does not pass through a fixed point. The slope of the target line is the slope of the tangent line of the second curve. We only need to translate the target line until it is tangent to the second curve. The processing of the target line is simpler, and we can also get the effect of the target line being tangent to the second curve, which meets the user's drawing intention.
[0096] Figure 5 The technical solution shown brings at least the following beneficial effects: by setting a second preset condition, it is possible to determine whether the user wants to draw the tangent of a certain curve, thereby accurately understanding the user's drawing intention, determining the second curve that the user wants to be tangent to the target line, and then adjusting the target line to be tangent to the second curve, thereby obtaining a more accurate drawing line and achieving better teaching results.
[0097] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0098] like Figure 12 As shown in the figure, this application embodiment also provides an electronic whiteboard for the electronic whiteboard line drawing method shown in the above method embodiment. The electronic whiteboard 200 includes: an acquisition module 201 and a processing module 202.
[0099] The acquisition module 201 is used to acquire the latest target line drawn by the user from multiple lines currently displayed on the electronic whiteboard; the processing module 202 is used to, when the target line is a curve, determine the curve whose endpoints among multiple lines satisfy a first preset condition as the first curve based on the first endpoint of the target line; the first endpoint is any endpoint of the target line, and the first curve is a different line from the target line; the processing module 202 is also used to determine a target point set based on the target line and the first curve, the target point set including the first endpoint, several points near the first endpoint on the target line, the second endpoint of the first curve, and several points near the second endpoint on the first curve, the second endpoint being the endpoint of the first curve that satisfies the first preset condition; the processing module 202 is also used to fit the points in the target point set into a transition curve connecting the target line and the first curve.
[0100] In one possible implementation, the processing module 202 is specifically used to: determine a first preset point from a first curve; determine a first preset number of abscissas from the abscissa interval between the second endpoint and the first preset point, and determine a first preset number of points on the first curve based on the first preset number of abscissas; or, determine a first preset number of ordinates from the ordinate interval between the second endpoint and the first preset point, and determine a first preset number of points on the first curve based on the first preset number of ordinates; determine a second preset point from a target line; determine a second preset number of abscissas from the abscissa interval between the first endpoint and the second preset point, and determine a second preset number of points on the target line based on the second preset number of abscissas; or, determine a second preset number of ordinates from the ordinate interval between the first endpoint and the second preset point, and determine a second preset number of points on the target line based on the second preset number of ordinates; and determine the first preset number of points and the second preset number of points as a target point set.
[0101] In another possible implementation, the processing module 202 is specifically used to: fit the points in the target point set according to multiple preset fitting functions to obtain multiple fitting curves; and use the fitting curve with the highest fitting degree among the multiple fitting curves as a transition curve to connect the target line and the first curve.
[0102] In another possible implementation, the processing module 202 is also used to: receive the drawing trajectory input by the user in the electronic whiteboard; and, if the drawing trajectory represents a curve, fit multiple drawing points constituting the drawing trajectory to obtain the target line.
[0103] In another possible implementation, the processing module 202 is further configured to: when the target line is a straight line, determine the curve whose shortest distance from multiple points on the line to the target line satisfies the second preset condition as the second curve, wherein the second curve is a different line from the target line; and move the target line to be tangent to the second curve.
[0104] In another possible implementation, the processing module 202 is specifically used to: when a coordinate axis is displayed on the electronic whiteboard and one endpoint of the target line is located on the coordinate axis, determine the tangent line among the multiple tangent lines of the second curve that passes through the starting point of the target line as the target tangent line, and the intersection point of the second curve and the target tangent line as the target tangent point; rotate the target line with the endpoint of the target line located on the coordinate axis as the rotation center until the target line is tangent to the second curve at the target tangent point; or, when a coordinate axis is displayed on the electronic whiteboard and the starting point of the target line is not on the coordinate axis, or when no coordinate axis is displayed on the electronic whiteboard, determine the point on the second curve with the smallest shortest distance to the target line as the target tangent point; translate the target line until the target line is tangent to the second curve at the target tangent point.
[0105] It should be noted that, Figure 12 The module division shown is illustrative and represents only one logical functional division; in actual implementation, other division methods are possible. For example, two or more functions can be integrated into a single processing module. These integrated modules can be implemented either in hardware or as software functional modules.
[0106] Another embodiment of this application also provides an electronic whiteboard, such as Figure 13 As shown, the electronic whiteboard 300 includes a memory 301 and a processor 302; the memory 301 and the processor 302 are coupled; the memory 301 is used to store computer program code, which includes computer instructions. When the processor 302 executes the computer instructions, the electronic whiteboard 300 performs each step of the method flow shown in the above method embodiment.
[0107] In actual implementation, the acquisition module 201 and the processing module 202 can be composed of... Figure 13 The processor 302 shown calls the computer program code in memory 301 to implement this. The specific execution process can be found in the description of the electronic whiteboard line drawing method section above, and will not be repeated here.
[0108] Another embodiment of this application provides a computer-readable storage medium storing computer instructions that, when executed on an electronic whiteboard, cause the electronic whiteboard to perform each step of the method flow shown in the above method embodiment.
[0109] In another embodiment of this application, a computer program product is also provided, which includes computer instructions that, when executed on an electronic whiteboard, cause the electronic whiteboard to perform each step of the method flow shown in the above method embodiment.
[0110] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), etc.
[0111] The above description is merely a specific embodiment of this application. Any variations or substitutions conceived by those skilled in the art based on the specific embodiments provided in this application should be covered within the protection scope of this application.
Claims
1. A method for drawing lines on an electronic whiteboard, characterized in that, An electronic whiteboard comprising a display device and a touch device, wherein the display device is used to display lines, and the touch device includes a writing area and a function control area; the writing area is used for the user to draw lines, and the function control area includes controls for line connection fitting and tangent fitting; the method includes: When the tangent fitting function is enabled, the latest target line drawn by the user is obtained from the multiple lines currently displayed on the electronic whiteboard, wherein the target line is a straight line; The curve whose shortest distance from a point on any of the multiple lines to the target line satisfies a second preset condition is defined as the second curve, which is a different line from the target line. The second preset condition includes: the shortest distance from a point to the target line is the smallest and is less than a second preset distance. Move the target line until it is tangent to the second curve; Moving the target line to be tangent to the second curve includes: When the electronic whiteboard displays a coordinate axis and the target endpoint of the target line is located on the coordinate axis, the tangent line among the multiple tangent lines of the second curve that passes through the target endpoint is determined as the target tangent line, and the intersection point of the second curve and the target tangent line is the target tangent point; with the target endpoint as the rotation center, the target line is rotated until the target line is tangent to the second curve at the target tangent point; or, If the target endpoint of the target line is not on the coordinate axis displayed on the electronic whiteboard, or if the coordinate axis is not displayed on the electronic whiteboard, the target tangent point is determined based on the slope of the target line and the second curve; the target line is translated until it is tangent to the second curve at the target tangent point. The target endpoint is any one of the endpoints of the target line.
2. The method according to claim 1, characterized in that, The method further includes: When the line connection fitting function is enabled, the latest target line drawn by the user is obtained from the multiple lines currently displayed on the electronic whiteboard, wherein the target line is a curve; Based on the first endpoint of the target line, the curve whose endpoint satisfies the first preset condition among the plurality of lines is determined as the first curve; the first endpoint is any one of the endpoints of the target line, and the first curve is a different line from the target line; A target point set is determined based on the target line and the first curve. The target point set includes the first endpoint, several points near the first endpoint on the target line, the second endpoint of the first curve, and several points near the second endpoint on the first curve. The second endpoint is the endpoint of the first curve that satisfies the first preset condition. The points in the target point set are fitted into a transition curve connecting the target line and the first curve.
3. The method according to claim 2, characterized in that, Determining the target point set based on the target line and the first curve includes: Determine a first preset point from the first curve; Determine a first preset number of abscissas from the abscissa interval between the second endpoint and the first preset point, and determine a first preset number of points on the first curve based on the first preset number of abscissas; or, Determine a first preset number of ordinates from the ordinate interval between the second endpoint and the first preset point, and determine a first preset number of points on the first curve based on the first preset number of ordinates; The step of determining the target point set based on the target line and the first curve further includes: Determine a second preset point from the target line; Determine a second preset number of abscissas from the abscissa interval between the first endpoint and the second preset point, and determine a second preset number of points on the target line based on the second preset number of abscissas; or... Determine a second preset number of ordinates from the ordinate interval between the first endpoint and the second preset point, and determine a second preset number of points on the target line based on the second preset number of ordinates; The first preset number of points and the second preset number of points are determined as the target point set.
4. The method according to claim 2, characterized in that, The first preset condition includes: the distance between the device and the first endpoint is minimized and is less than a first preset distance; The step of fitting the points in the target point set into a transition curve connecting the target line and the first curve includes: The points in the target point set are fitted according to multiple preset fitting functions to obtain multiple fitting curves; The fitting curve with the highest fitting degree among the multiple fitting curves is used as the transition curve to connect the target line and the first curve.
5. The method according to any one of claims 2-4, characterized in that, Before obtaining the latest target line drawn by the user from the multiple lines currently displayed on the electronic whiteboard, the method further includes: Receive the drawing trajectory input by the user on the electronic whiteboard; In the case of the drawn trajectory representing the curve, the target line is obtained by fitting multiple drawing points that constitute the drawn trajectory.
6. An electronic whiteboard, characterized in that, include: The display module is used to display lines; The touch module includes a writing area and a function control area. The writing area is used for users to draw lines, and the function control area includes controls for line connection fitting and tangent fitting. The acquisition module is used to acquire the latest target line drawn by the user from multiple lines currently displayed on the electronic whiteboard when the tangent fitting function is enabled; where the target line is a straight line. The processing module is used to determine the curve whose shortest distance from a point on the plurality of lines to the target line satisfies a second preset condition as a second curve, wherein the second curve is a different line from the target line; The second preset condition includes: the shortest distance from the point to the target line is the smallest and less than the second preset distance; the target line is moved to be tangent to the second curve; The processing module is specifically configured to: when a coordinate axis is displayed on the electronic whiteboard and the target endpoint of the target line is located on the coordinate axis, determine the tangent line among the multiple tangent lines of the second curve that passes through the target endpoint as the target tangent line, and the intersection of the second curve and the target tangent line as the target tangent point; rotate the target line with the target endpoint as the rotation center until the target line is tangent to the second curve at the target tangent point; or, when a coordinate axis is displayed on the electronic whiteboard and the target endpoint of the target line is not on the coordinate axis, or when the coordinate axis is not displayed on the electronic whiteboard, determine the target tangent point based on the slope of the target line and the second curve; translate the target line until the target line is tangent to the second curve at the target tangent point; the target endpoint can be any endpoint of the target line.
7. The electronic whiteboard according to claim 6, characterized in that, The acquisition module is further configured to, when the line connection fitting function is enabled, acquire the latest target line drawn by the user from the multiple lines currently displayed on the electronic whiteboard, wherein the target line is a curve; the processing module is further configured to: determine the curve whose endpoints satisfy a first preset condition among the multiple lines as a first curve based on the first endpoint of the target line; the first endpoint is any one of the endpoints of the target line, and the first curve is a different line from the target line; A target point set is determined based on the target line and the first curve. The target point set includes the first endpoint, several points near the first endpoint on the target line, the second endpoint of the first curve, and several points near the second endpoint on the first curve. The second endpoint is the endpoint of the first curve that satisfies the first preset condition. The points in the target point set are fitted into a transition curve connecting the target line and the first curve; The processing module is specifically used to: determine a first preset point from the first curve; determine a first preset number of abscissas from the abscissa interval between the second endpoint and the first preset point; and determine a first preset number of points on the first curve based on the first preset number of abscissas. Alternatively, a first preset number of ordinates can be determined from the ordinate interval between the second endpoint and the first preset point, and a first preset number of points on the first curve can be determined based on the first preset number of ordinates. Determine a second preset point on the target line; determine a second preset number of abscissas from the abscissa interval between the first endpoint and the second preset point; and determine a second preset number of points on the target line based on the second preset number of abscissas. Alternatively, a second preset number of ordinates can be determined from the ordinate interval between the first endpoint and the second preset point, and a second preset number of points on the target line can be determined based on the second preset number of ordinates. The first preset number of points and the second preset number of points are determined as the target point set; The first preset condition includes: the distance between the device and the first endpoint is minimized and is less than a first preset distance; The processing module is specifically used to: fit the points in the target point set according to multiple preset fitting functions to obtain multiple fitting curves; and use the fitting curve with the highest fitting degree among the multiple fitting curves as a transition curve to connect the target line and the first curve. The processing module is further configured to: receive a drawing trajectory input by the user in the electronic whiteboard; and, if the drawing trajectory represents a curve, fit multiple drawing points constituting the drawing trajectory to obtain the target line.
8. An electronic whiteboard, characterized in that, include: One or more processors; One or more memory units; Wherein, the one or more memories are used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the electronic whiteboard performs the electronic whiteboard line drawing method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed on a computer, cause the computer to perform the electronic whiteboard line drawing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Drawing processing method and device
CN114296584A